If you want to quickly fill a subnet with ip addresses for a host, instead of manually adding interface aliases to the rc.local you can achieve the same thing with core networking support by doing the following in RHEL / Centosquickly add ip address range in linux

in /etc/sysconfig/network-scripts

add a file called


here ethX is the network interface ID you want to have the alias range on, so for eth0 you could use


Using your favorite text editor, vi, pico, gedit, in our case, vi add the following


Now you will need to fill this out, so for example


The “CLONENUM_START” value is equal to the alias interface number you would start with this range. In this case, the first IP  will be binded to “eth0:0″. While you can start with any value for simplicity its best you start with a single digit number


If you do not have CENTOS/ RHEL or are using something other than these , you can always edit the rc.local and add interface aliases manually

For Example

/sbin/ifconfig eth0:0 netmask

will work with most distrobutions, including RHEL, CENTOS. Slackware, SuSe, for Ubuntu you may need to make the line

sudo /sbin/ifconfig eth0:0 netmask

‘The easiest way to check is at the root rompt # type the command

which ifconfig

on most RPM distros this comes back as /sbin/ifconfig, if your path is different than above, then change the ifconfig path to suite your needs.