Say for example if you want to add the following different ip ranges in your server on the Ethernet port eth0. Here are few simple steps to add the ip ranges in few minutes.
IP Block: 188.8.131.52-134
IP Block: 184.108.40.206-6
IP Block: 220.127.116.11-14
IP Block: 18.104.22.168-22
IP Block: 22.214.171.124-30
The above example has around 6 ranges with different ip sets. You can make use of the ‘ ifcfg-eth0-rangeX ‘ feature to get this done simply. Ssh your server as root.
- # cd /etc/sysconfig/network-scripts
Create a file named ifcfg-eth0-range0
- # vi ifcfg-eth0-range0
Add the following lines as below to add the first set of range ( iee..126.96.36.199-134 )
Save your works and exit. Restart the network service using ‘ service network restart ‘ . To add the second range you need to create another file called ‘ ifcfg-eth0-range1 ‘ with the CLONENUM_START start with 5 (setting up the number in CLONENUM_START is very important here to avoid the ip overwritten, as the first range will use up to the eth0:4 the second range should start with eth0:5 to work properly).
Save your works and restart the network service. You can do the same for the other ip ranges left with carefully numbering the CLONENUM_START. Use the ifconfig command to check the eth0:X number everytime you restarts. After adding all the ranges, use ping to check the ips to make sure they are added properly.