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
netmask 255.255.255.0

Fill in the address with your new IP address.

Increment each new IP address interface by :1.

eth0:1
eth0:2
etc

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
visit 
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)