Verified and Tested 06/30/2015
In this How-to, we will learn how to configure a private IP address on a Debian 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.
**NOTE** – This how-to works for the following Debian 32 or 64-bit versions.
-A server with Debian. If you do not have a server already, you can visit our Cloud Hosting page and spin a new server up in 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
Signing into Cloud Control Panel
Once logged in, you will see “Private IPs” on the left side listed.
Navigating to your Private IPs
On the Private IP page, you will see the IP range allocated to your account. Under “IP” are the Private IPs available to use.
Private IP page
Once you have the private IP range to use, we will add it to our Debian server.
Adding the Private IP address to your Debian Server
Login 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.
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 will need to restart networking for the changes to take effect.
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
RX bytes:4665282 (4.6 MB) TX bytes:1632 (1.6 KB)
Now you have successfully added a Private IP to your Debian Server! Don’t forget to check out our many other articles and keep checking back for more.