Add a series of IP addresses in linux.

Here I am talking about Redhat/Centos.. Not Debian versions…

I got into a situation where I have to add atlease 64 public IP address to an interface.
If I do it manually then it is going to to take lot of time.Also lot of mistakes..
Googling given me this solutions.

Say for example you want to give multiple ips to the eth0 interface.

1. Go to the network inteface directory


2.Create a special interface file as below

vi ifcfg-eth0-range0

Here starting IP address is and Ending IP Address is
Clonenum Start indicates virtual interface starting number. Say, for example in this case the fist virutal
interfaces will be eth0:14,eth0:15 and so on.

3.Restart the network

/etc/init.d/network restart

Saved at-least an hour.!!

Leave a Reply