This article describes how to add multiple IP addresses to centos. For more information, see CentOS.
Log on to SSH as follows:
Copy codeThe code is as follows:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0: 0
The second IP address is
Copy codeThe code is as follows:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0: 1
The third IP address is
Ifcfg-eth0: 2 (and so on)
Copy codeThe code is as follows:
DEVICE = eth0: 0 Nic DEVICE name
Onboot = YES random start
BOOTPROTO = static IP address allocation
IPADDR = *. * The IP address to be added
NETMASK = 255.255.255.0 subnet mask (subject to actual conditions)
GATEWAY = *. * route
If the IP address is continuous, you can use the following method.
Copy codeThe code is as follows:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0-range
DEVICE = eth0
BOOTPROTO = static
IPADDR_START = start IP address
IPADDR_END = end IP address
CLONENUM_START = start number of the NIC
NETMASK = subnet mask
ONBOOT = yes
Save the file and restart the network service.