Verified and Tested 10/31/2015
In this How-to, we will learn how to configure a private IP address on an Ubuntu Server.
Private networking is a great way to keep the traffic between your servers internal and not accessible publicly. It allows you to communicate between your servers without using your Cloud bandwidth as well. It is also faster than public traversal as it will not require leaving the network to reach the destination server. At this time private networking within our Cloud will only be able to communicate with same region servers.
-A server with Ubuntu. If you do not have a server already, you can spin up any of our affordable cloud hosting solutions under 30 seconds.
Verifying your Private IP range with our Cloud Control Panel
First, we will need to find out what you are allocated for your private IP range. If you have a Cloud server with us, I will go through how to find the Private IP address range you are allocated. If you do not know your private IP range or address, please consult your network administrator.
Sign into your Cloud Control Panel
Once logged in, you will see “Private IPs” on the left side listed.
On the Private IP page, you will see the IP range allocated to your account. Under “IP” are the Private IPs available to use.
Once you have the private IP range to use, we will add it to our Ubuntu server.
Adding the Private IP address to your Ubuntu Server
Log in to your server and use your text editor to open /etc/network/interfaces .In this tutorial, we will be using nano.
We will need to add the private IP address as an additional IP on the next available interface. In this tutorial, it will be eth1.
We will need to add the following under the last interface configuration.
auto eth1 iface eth1 inet static address XX.XX.XX.XX <--- Private IP address netmask 255.255.255.0 <--- Subnet Mask for Private IP range
After you have added the new private IP, save and exit.
You now need to bring up eth1 with the following command:
sudo ifup eth1
If you already have an eth1 configured. You will need to drop eth1 and bring it up again with the following command:
sudo ifdown eth1 && sudo ifup eth1
After restarting the networking, you should be able to run the following command to verify the private IP is configured and came up just fine.
You should see an output similar to this:
eth1 Link encap:Ethernet HWaddr 00:00:0a:d0:6c:46 inet addr:XX.XX.XX.XX Bcast:XX.XX.XX.XXX Mask:255.255.255.0 inet6 addr: xx11::111:xxx:xxx0:1x46/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:81896 errors:0 dropped:0 overruns:0 frame:0 TX packets:22 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4665282 (4.6 MB) TX bytes:1632 (1.6 KB)
Now you have successfully added a Private IP to your Ubuntu Server! Don’t forget to check out our many other articles and keep checking back for more. Atlantic.Net has a selection of industry-leading cloud servers for a wide variety of business needs.