Knowledgebase:
CentOS :: Add Additional IP(s)
Posted by , Last modified by on 13 May 2012 02:21 AM
In this Example we are using a minimal install of CentOS 6.2. The most basic setup and the one we typically install

First, Login as root

Step 01

change directory to where the network interfaces are located

cd /etc/sysconfig/network-scripts/

Step 02

Just verify what adapters are in this directory (by issuing a ls) as some servers have more then one Ethernet card. In this example we only have one and we are concerned with ifcfg-eth0

Step 03

Verify the Adapter (ifcfg-eth0) setting by viewing (cat/more/less) the file. We are just making sure there are the most basic settings because we are going to use this one as a template for the other bound IP's. Please also verify the netmasking in your configuration making sure its setup properly. In this example we are using a /29 so it will be 255.255.255.248

Step 04

For this example ill be adding 3 more ip addresses. For each IP you will need a config file for this. Since ifcfg-eth0 is taken the would be numbered accordingly:

ifcfg-eth0:0
ifcfg-eth0:1
ifcfg-eth0:2

Copy ifcfg-eth0 to the above examples:

cp ifcfg-eth0 ifcfg-eth0:0
cp ifcfg-eth0 ifcfg-eth0:1
cp ifcfg-eth0 ifcfg-eth0:2 

Step 05

Load each of the newly created adapters into the editor of your choice; In this example ill be using nano

The entries we need to change are the DEVICE="" and IPADDR=""

The modified entries are below:

Step 06

Step 07

Step 08

Step 09

After this has been done, issue a service network restart; then ping one of the ips you added, if you have done everything correctly it will ping.

Step 10

 
There is a good article on the CentOS docs page:

http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-networkscripts-interfaces.html

As always if you have additional questions please EMail support.

 

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: