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

If you are using CPanel, you should add the IP addresses through WHM.  Do not follow these instructions if you are using CPanel.

If you want to assign the addresses 3.2.1.1 – 3.2.1.20 to your server, you will need to create a RANGE file.

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


If you already have a range file, you will need to create a new one for the new range of IPs you are adding, eg ‘nano ifcfg-eth1-range1` .  If you have one named range1, name the next range2 and so on.

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

Note: 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 –a | grep eth1’.  This will list devices such as eth1:0, eth1:1, eth1:2, and so on.  If you are currently using upto eth1:16, you will need to set CLONENUM_START to 17 to assign the IPs correctly.

When done, just type below to restart your network

service network restart

Дали Ви помогна овој одговор?

 Испечати

Исто така прочитајте

How to re-install Centos yourself remotely

NOTE: This is only for Dedicated Servers. All VPS, go to client area.Assuming you currently have...

How can upgrade kernel on xen main node or container too?

Centos:on host node---yum updatecd /usr/local/lxlabs/hypervm/httpdocs/lphp.exe...

Hints on Creating Windows KVM Templates

Templating Windows is a fairly easy process for KVM. All versions of windows can be resized by...

How to restore all data from old drive to a new drive on a cpanel server

You basically ssh to server as root and look for your old/original drive via command fdisk -l...

Fix WHM/cPanel cPHulk Brute Force Protection Lock Out Via SSH

ssh to the server and login as root then type   mkdir /home/cphulkchmod 777...