Add multiple IPs to a server

For example if you want to add a few IPs from the 111.123.123.1 class:

[root@box ~]# cd /etc/sysconfig/network-scripts/ - this is where the network settings are being searched for

[root@box network-scripts]# vi ifcfg-eth0-range0 - this will be the file where we define the new IP class(considering that our main interface is called eth0)

Add this content to the file:

IPADDR_START=111.123.123.1
IPADDR_END=111.123.123.28
CLONENUM_START=1
NETMASK=255.255.255.240

Explanation:

IPADDR_START - the first IP of the class you want to add

IPADDR_END - last IP of the class you want to add

CLONENUM_START - the number with which the virtual interface will start, this will create the virtual interfaces eth0:1 to eth0:28.

If you have more classes that you want to add on the next class CLONENUM will start at 29.

NETMASK - the mask for the IP class

After all this was added to the file and edited accordingly just save and restart the network.

Next class will be added same way only that you create a new file for it:

[root@box network-scripts]# vi ifcfg-eth0-range1

Was this answer helpful?

 Print this Article

Also Read

Easy ruTorrent installer + Web server, FTP, Webmin (Ubuntu/Debian/Fedora/More)

All credit goes to Author brock from forums.rutorrent.org  original post here for reference also...

Changing permissions only on files or only on directories

The following two commands will change the permissions only on the files in a directory even...

How to unzip

Linux has both zip and unzip program. By default, these utilities not installed, To install...

Debian asking to insert cdrom to update?

open a terminalsunano /etc/apt/sources.listput a # in front of the line talking bout cd's (or...

How to install csf

How to install csf: wget http://www.configserver.com/free/csf.tgz tar zxvf csf.tgz cd csf...