Ubuntu 14 / 16

Ubuntu works with a single network configuration file. You can find the file at /etc/network/interfaces. Now we will edit the configuration file, we recommend to use ‘nano’ to edit the file:

nano /etc/network/interfaces

Copy the text at eth0:1 and edit the bold text that fits your situation:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.50
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 93.190.136.10 217.23.0.121

auto eth0:1
iface eth0:1 inet static
address 192.168.1.51
netmask 255.255.255.0

When you exit the text editor you can apply the changes by using the following command:

ifup eth0:1

Should you want to add more static addresses you can follow the logic by repeating the steps above and use eth0:2 instead.

If you are unsure if your configuration is correct feel free to contact us here.