One, add a single IP address:
In/etc/sysconfig/network-s/, the new file ifcfg-eth0:*,* is a numeric ordinal, and multiple IPs are incremented
Take 0 As an example to establish a file ifcfg-eth0:0
cd/etc/sysconfig/network-s/
VI ifcfg-eth0:0
Input content format:
device=eth0:0
Type=ethernet
Onboot=yes
Bootproto=static
Ipaddr= to add the IP address of the binding
netmask= Subnet Mask
gateway= Gateway Address
Second, batch add multiple IP address:
Create a new file in/etc/sysconfig/network-s/ifcfg-eth0-range0
Vi/etc/sysconfig/network-s/ifcfg-eth0-range0
Enter the following file content format:
Device=eth0
Onboot=yes
Bootproto=static
ipaddr_start= Start IP Address
ipaddr_end= End IP Address
Clonenum_start=0
gateway= Gateway Address
netmask= Subnet Mask
No_aliasrouting=yes
Once saved, run the service network restart to restart the Web services!
Jiangsu Three AI Network Technology Co., Ltd.
Add a single IP to CentOS (Linux) and add multiple IP local methods in bulk