How to Add an Additional IP Address to an Interface in Ubuntu 14

aliasip address

I want to have the wired interface simultaneously obtain a DHCP address, and also alias a fixed address so I can communicate with a device with a fixed IP address on a different subnet over the same link.

When searching for IP address aliasing in Ubuntu, I found this article How do I add interface aliases using Network Manager GUI?. Unfortunately, the Edit Connections GUI in Ubuntu 14 does not have the "additional addresses" button.

Where has this functionality moved?

Best Answer

Skip the gui and do it via command line.

The following link provides detailed information on how to create the alias on a temporary basis, as well as how to edit the interfaces file to make the change permanent.

Information from site in case of site death:

ifconfig command line

You can use ifconfig command to configure a network interface and alias. For example:

  • eth0 NIC IP
  • eth0:0 first NIC alias:

To setup eth0:0 alias type the following command as the root user:

# ifconfig eth0:0 up

Verify alias is up and running using following command:

# ifconfig -a

# ping

However, if you reboot the system you will lost all your alias. To make it permanent you need to add it network configuration file.

# vi /etc/network/interfaces

Append the following to the file (This is in addition to existing information, not a replacement for it)

auto eth0:1
iface eth0:1 inet static
name Ethernet alias LAN card

Save and close the file. Restart the network:

# /etc/init.d/networking restart