Add different IP segments in batches to a single network card
70.39.112.194 Add IP:70.39.112.195-222/70.39.83.226-254
vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR_START=70.39.112.195
IPADDR_END=70.39.112.222
CLONENUM_START=0
GATEWAY=70.39.112.193
NETMASK=255.255.255.224
NO_ALIASROUTING=yes
service network restart
After ifconfig, I saw IP:70.39.112.195-222 corresponding network card number: eth0:0-eth0:27,
So when adding IPs in batches, the network card only needs to start from eth0:28 or later,
The network card eth0 remains unchanged, create a new file: ifcfg-eth0-range1
vi /etc/sysconfig/network-scripts/ifcfg-eth0-range1 #Note that this will change the second time
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR_START=70.39.83.226
IPADDR_END=70.39.83.254
CLONENUM_START=28 #Note that this will change the second time
GATEWAY=70.39.83.225
NETMASK=255.255.255.224
NO_ALIASROUTING=yes
The above is the detailed content of How to add different IP segments in batches on CentOS single network card?. For more information, please follow other related articles on the PHP Chinese website!