Saturday, December 19, 2009

Network

Primary Network Configuration files

/etc/hosts — The main purpose of this file is to resolve hostnames that cannot be resolved any other way. It can also be used to resolve hostnames on small networks with no DNS Server
/etc/resolv.conf — This file specifies the IP addresses of DNS servers and the search domain
/etc/sysconfig/network — Specifies routing and host information for all network interfaces
/etc/sysconfig/network-scripts/ifcfg- — For each network interface, there is a corresponding interface configuration script. Each of these files provide information specific to a particular network interface

Ethernet Interfaces
Linux network interface names start with ethX. First Ethernet network interface name is eth0, second is eth1 and so on

Loopback Interface
ifcfg-lo — A local loopback interface is often used in testing, as well as being used in a
variety of applications that require an IP address pointing back to the same system. Any data
sent to the loopback device is immediately returned to the host's network layer

Alias
Alias interface configuration files, which are used to bind multiple addresses to a single interface, use the ifcfg-: naming scheme
ifcfg-eth0:0 file could be configured to specify DEVICE=eth0:0
Alias interfaces do not support DHCP

Network Administration Tool
# system-config-network
or
# setup

To list or display information about all network interface
# ifconfig -a

To assign ip address to a interface temporarily 
# ifconfig eth0 192.168.1.1 netmask 255.255.255.0 up

To bring up ethX, where X can be 0,1,2....
# ifup ethX

To bring down ethX
# ifdown ethX

To restart network Services
# service network restart

To assigns hostname to a machine
# hostname name

Using DHCP to Obtain an IP Address
# dhcpcd eth0

No comments:

Post a Comment