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