How do I assign additional IP addresses in RedHat/CentOS?

To assign a range of addresses to your server you'll need to create a RANGE file. To do so please follow these steps:

# cd /etc/sysconfig/network-scripts
# ls ifcfg-eth1-range*

If a range file has already been created, you will need to create a new one for the new range of IPs you are adding. For example if you have one named range1, name the next range2 and so on. In the event there isn't, run this command:

# nano ifcfg-eth1-range1

Place the following text in the file:

IPADDR_START=192.168.0.10
IPADDR_END=192.168.0.110
CLONENUM_START=0

CLONENUM_START defines where the alias will start. If this is the second range file, you will need to set
CLONENUM_START to a value higher than the number of IP addresses assigned. To check what you currently have used, you can run:

# ifconfig | grep eth1

This will list devices such as eth1:0, eth1:1, eth1:2, and so on. If you are planning to maximize your ranges up to eth1:3, you'll set CLONENUM_START to 4 to assign the IPs correct

  • 2 Users Found This Useful
Was this answer helpful?