How to add an IP address to a Ubuntu server

First, make a backup of the /etc/network/interfaces file.

cp /etc/network/interfaces /root/interfaces.bak

Edit the /etc/network/interfaces file.

vi /etc/network/interfaces

Add a section for as many IP addresses as you are adding.

auto eth0:0
iface eth0:0 inet static
address xx.xx.xx.xx

Fill in the address with your new IP address.

Increment each new IP address interface by :1.


When you are finished save the file. You can reboot the server for the new IP addresses to take effect, or issue the following command:

/etc/init.d/networking restart

To verify your new settings, issue the following command.

ifconfig -a

This article has been provided by Codero Hosting, the leading provider of reliable
dedicated, managed and cloud hosting services. Need more information on this
topic or to learn more about Codero’s hosting services please
www.codero.comchat with us online or give us a call at 866-2-CODERO. 
Posted in
Last update:
2015-12-03 20:39
Average rating:0 (0 Votes)