When a system is installed with CentOS 6 minimal version, it's network is not configured initially and has to be manually taken care of. There are two ways of going about this:
DHCP
- vi /etc/sysconfig/network-scripts/ifcfg-eth0
- ONBOOT = yes
- NM_CONTROLLED = no
- BOOTPROTO = dhcp
- vi /etc/sysconfig/network [Hostname is needed to be specified for DHCP to work]
- NETWORKING = yes
- HOSTNAME =
- vi /etc/resolv.conf [Optional]
- search
[ex: lab1.mycompany.com finance.mycompany.net abc.mycmp.com] - nameserver
- Once all the above steps are done, restart the networking service:
- /etc/init.d/network restart
You can also consider using "dhclient eth0" to obtain an ip address for eth0 from dhcp server.
Static IP Address
- vi /etc/sysconfig/network-scripts/ifcfg-eth0
- ONBOOT = yes
- NM_CONTROLLED = no
- BOOTPROTO = none
- IPADDR =
- NETMASK =
[for a /24 network it will be 255.255.255.0] - GATEWAY =
[Optional] - USERCTL = yes/no [Optional] (yes - allows non-root users to control this device)
Additional configuration parameters are defined in the CentOS documentation
Comments