Configure multiple IP addresses in linux
The Red Hat Linux is used as an example. Assume that the original system has configured an IP Address: 192.168.0000140, the configuration file path/etc/sysconfig/network-script/ifcfg-eth0. Now you need to configure an IP address with the network segment 192.168.1.
STEP (root user permission required ):
1, cp/etc/sysconfig/network-script/ifcfg-eth0/etc/sysconfig/network-script/ifcfg-eth1
2, vi/etc/sysconfig/network-script/ifcfg-eth1 to modify the black part, colon plus 1
DEVICE = eth0: 1
BOOTPROTO = none
ONBOOT = yes
HWADDR = 00: 0c: 29: ee: a6: 11
NETMASK = 255.255.255.0
IPADDR = 192.168.1.140
TYPE = Ethernet
USERCTL = no
IPV6INIT = no
PEERDNS = yes
3. The service network restart takes effect for the modified configuration.
4. View through ifconfig. Then, you will see an additional eth1 IP configuration.
Reference: http://world77.blog.51cto.com/414605/368529