Help and Knowledge
Configuring an Additional IP Address on a Linux Server
This document will take you through the process of adding an additional IP address to a Linux Server Network Configuration. The files you need to amend vary based on the distribution of Linux installed; however, all changes are executed at the command line that is accessed via SSH using the default IP address of your server.
To get SSH access, you will need your root password (displayed in the Tagadab Control Panel) and an SSH
client. We recommend Putty, which can be downloaded for free at:
Consult the Tagadab guide, Connecting to a Linux Server via SSH for instructions on how to download and configure Putty to launch the terminal window with the command line.Follow the below steps once you have a terminal window open:
Configuring an IP Address for Ubuntu & Debian
- Open /etc/network/interfaces.
An example of the file is below:
- Below the line:
Add the following line:
- Below the first interface description iface eth0 add the description of the second interface:
iface eth0:1 inet static
Make sure the mask and gateway are correct. These would be identical to the ones already specified. The only thing that changes is the IP address you want to add. The resulting file should look like this:
Configuring an IP Address for Centos
The process for Centos is slightly different in that you create a new interface file instead of amending and adding to the existing one.
- Go to the following directory on your server:
Screen 3If you do an ls on this directory, you will see several files listed as illustrated below:
- Verify which interface you will use to add IP addresses. Typically, this will be eth0 for public IP
This will produce output similar to the following:
- Make a copy of ifcfg-eth0 for each IP you wish to add and name them ifcfg-eth0:0,
ifcfg-eth0:1, as shown below. Press 'Return' after each cp command:
- Open each command and change the DEVICE, IPADDR and NETMASK fields accordingly.
A sample entry for each file would look like this:
- Restart the network service:
Screen 8Apply the changes made to the network configuration. Watch for any errors identified when restarting the service.
- Use the following command again to verify the IP address assigned to your server:
Try to get SSH access to the server using the newly-added IP address to make sure it has been correctly added and is properly working.