From: http://blog.csdn.net/leave00608/article/details/19814063
1. Configure the nic ip Address
Vim/etc/sysconfig/network-scripts/ifcfg-eth0 device = eth0 # physical device name ipaddr = 192.168.1.100 # IP address netmask = 255.255.255.0 # mask value network = 192.168.1.0 # network address (optional) broadcast = 192.168.1.255 # broadcast address (optional) gateway = 192.168.1.1 # gateway address onboot = yes # [Yes | no] (whether to activate the device during boot) userctl = No # [Yes | no] (whether non-root users can control the device) bootproto = static # [none | static | BOOTP | DHCP] (no protocol used during boot | static allocation | BOOTP protocol | DHCP protocol)
2. Configure Nic DNS
Vim/etc/resolv. confvi/etc/resolv. confnameserver 202.109.14.5 # primary dnsnameserver 219.141.136.10 # secondary DNS
3. Restart the NIC
service network restart
Centos 6.5 network configuration (reprinted)