1. add a single IP address 1, enter/etc/sysconfig/network-scripts/to create a file ifcfg-eth0: *, * is the number, multiple IP addresses increase in turn to 0 as an example, create file ifcfg-eth0: 0 # cd/etc/sysconfig/network-scripts/# viifcfg-eth0: 0 & nb
1. add a single IP address
1. enter/etc/sysconfig/network-scripts/to create a file ifcfg-eth0: *, * is the number, multiple IP increases in turn
Take 0 as an example to create a file ifcfg-eth0: 0
# cd /etc/sysconfig/network-scripts/
# vi ifcfg-eth0:0
2. enter the content in the following format:
DEVICE = eth0: 0 TYPE = Ethernet ONBOOT = yes BOOTPROTO = static IPADDR = IP address to be bound NETMASK = subnet mask GATEWAY = GATEWAY address
3. after saving, run service network restart to restart the IP address added by the network service.
# service network restart
2. add multiple IP addresses in batches
1. enter/etc/sysconfig/network-scripts/to create a file ifcfg-eth0-range0
# vi ifcfg-eth0-range0
2. enter the content in the following 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
3. after saving and exiting, run service network restart to restart the network service.
# service network restart