Define IP Address:
1. Root # Vim/etc/sysconfig/network-scripts/ifcfg-eth0 # edit the NIC configuration file
Device = eth0 # Nic device name
Onboot = yes # Does the NIC need to be automatically started?
Ipaddr = 192.168.1.1 # IP Address
Netmask = 255.255.255.0 # mask
Gateway = 192.168.1.254 # Gateway
Dns1 = 202.96.134.133 # primary DNS
Dns2 = 8.8.8.8 # secondary DNS
2. Root # service network restart # restart the NIC
Define secondary IP Address:
1.1.root # Vim/etc/sysconfig/network-scripts/ifcfg-eth0: 0 # edit the secondary configuration file for the NIC
2. device = eth0: 0 # Name of the secondary ENI Device
3. onboot = yes # Does the NIC need to be automatically started?
4. ipaddr = 192.168.2.1 # IP Address
Netmask = 255.255.255.0 # mask
If many secondary IP addresses are required, you can add eth0: 1; eth2... when editing the NIC.
This article is from the "centos" blog, please be sure to keep this http://longcentod.blog.51cto.com/9060910/1436620 source