How to Add a Private IP to a Centos 6 Server

Michael Douse
by (10posts) under Cloud Hosting
Verified and Tested 08/27/15


In this article, we will go over how to configure a private IP on a freshly provisioned CentOS 6.6 cloud server. Every cloud account comes with a pre-allocated private IP range that can be used to link cloud servers. This is ideal in certain cases, such as wanting to separate the roles of your web server and database. It is also important to note that private LAN traffic is not metered and does not count towards your allotted outbound data transfer allowance.


  • CentOS 6.X (32 bit or 64 bit) server.
  • Root permissions.

Determine your private range

Login to your cloud control panel and click on “Private IP’s” to see what private range has been allocated to you.

Assigned Private range.

Cloud control panel Private IP range.

Configure Secondary Network Interface

Let’s start off by taking a look at our current network interface configuration:

ifconfig -a

The output will resemble this:

eth0 Link encap:Ethernet HWaddr 00:00:68:F5:27:34
 inet addr:XXX.XXX.XXX.XXX Bcast:XXX.XXX.XXX.XXX Mask:
 inet6 addr: XX::XX:XX:XX:XX/64 Scope:Link
 RX packets:1403 errors:0 dropped:0 overruns:0 frame:0
 TX packets:1065 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:95663 (93.4 KiB) TX bytes:72683 (70.9 KiB)
eth1 Link encap:Ethernet HWaddr 00:00:0A:F5:27:34
 inet6 addr:XX::XX:XX:XX:XX/64 Scope:Link
 RX packets:281 errors:0 dropped:0 overruns:0 frame:0
 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
 collisions:0 txqueuelen:1000
 RX bytes:12114 (11.8 KiB) TX bytes:398 (398.0 b)

As seen above, there are two network interfaces currently on the server. For Atlantic.Net VPS, ETH0 will always be the public interface and ETH1 will always be used for private IP’s.

Now we need to change to the directory where the interface configuration files are located and take a look at the ETH1 config file:

cd /etc/sysconfig/network-scripts/
cat ifcfg-eth1
# Virtio Network Device Private Interface

As you can see, ETH1 does not currently have an IP assigned to it. We will need to edit it with a text editor. In this example, I will be using “nano”:

nano ifcfg-eth1

Append the following to the ETH1 config file and add the private IP you chose to it:

Close and save the changes you made. Then restart the networking service.

service network restart

That’s it! Now go do the same thing on another VPS to establish local connectivity.

Related Posts

New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

Dallas, TX

2323 Bryan Street,

Dallas, Texas 75201

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4