About Add Additional IPs for Linux Server

1. Determine if an existing range files exist:

# cd /etc/sysconfig/network-scripts/

# ls ifcfg-eth1-range*

Note: If the server is using a bonded network, the files will be ifcfg-bond1-range*

You may see at least one file, though there may possibly be several. Find the highest number following the “range” and add one to it. This will be the new range number.

For example, if you see ifcfg-eth1-range0 and ifcfg-eth1-range1, your new range number will be “2”.

If there are not any range files already present, create one using your favorite text editor (i.e. vi, nano, ect.).

2. Determine the next available interface number (clone number).

# ifconfig | grep eth1

You will see a list of interfaces that looks like this
eth1 Link encap:Ethernet HWaddr 00:08:74:A3:29:70
eth1:0 Link encap:Ethernet HWaddr 00:08:74:A3:29:70
eth1:1 Link encap:Ethernet HWaddr 00:08:74:A3:29:70
.
.
.
eth1:8 Link encap:Ethernet HWaddr 00:08:74:A3:29:70

Find the highest number after the “eth1:”. Add one to it and this your new clone number. In this case it would be 9. In case this is a new file, the clone number will be 0.

3. Create a range file for the new range number. (for this example, we will use range2)

# vi ifcfg-eth1-range2

4. Write the following lines to the range file. (replace the dummy ip information with your desired ip range and the CLONENUM_START value with the one calculated above [please also note that this procedure/example is being outlined under the assumption that this is a standard secondary subnet])

IPADDR_START=’123.0.0.1′
IPADDR_END=’123.0.0.10′
NETMASK=255.255.255.255
CLONENUM_START=’9′

Note: If the range only has one IP, use the same IP for the “START” and “END” IPs.

5. Write and quit the range file, and restart your network.

# /etc/init.d/network restart

6. Your new ips should now be visible by running:

# ifconfig

Leave a Comment

*