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

 

To assign a new 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-eth0-range*

If your ouput is:

 

[root@localhost network-scripts]#  ls ifcfg-eth0-range*

ifcfg-eth0-range0  ifcfg-eth0-range1

 

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:

# vi ifcfg-etho-range2  {since range 1 already exists}

Place the following text in the file:

IPADDR_START=192.xx.xx.xx
IPADDR_END=192.xx.xx,.xx
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:

i.e:

eth0      Link encap:Ethernet  HWaddr 00:26:6C:F2:D6:F8

eth0:0    Link encap:Ethernet  HWaddr 00:26:6C:F2:D6:F8

eth0:1    Link encap:Ethernet  HWaddr 00:26:6C:F2:D6:F8

eth0:2    Link encap:Ethernet  HWaddr 00:26:6C:F2:D6:F8

eth0:3    Link encap:Ethernet  HWaddr 00:26:6C:F2:D6:F8

eth0:4    Link encap:Ethernet  HWaddr 00:26:6C:F2:D6:F8

 

on new Range

CLONEMUM_START=5 would be correct.

 

# ifconfig | grep eth0  { RUN ifconfig to get what eth device is being used}

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 correctly.

Written by:

Rishi Padooman
President and Founder of Host NIT Inc.
www.hostnit.com
www.cpanelhosting.com

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

{cPanel} Viewing cron jobs through SSH

You can use the command crontab -lTo view all od "root" cron jobs.To be more user specific,...

{cPanel + CentOS} How to install cPanel on a CentOS server via ssh?

{cPanel + CentOS} How to install cPanel on a CentOS server via ssh?   Please follow the...

Setup static IP in Debian OS {Debian 6xx}

Basic Setup of a Static  IP for Debian 6xx You'll first need to find out what your...

Recover Centos root Passwod

1. Boot the system and when you see the following message "Press any key to enter the menu",...