Add second IP-address to interface in 17.10

Turns out in 17.10 you edit your network settings in /etc/netplan/01-netcfg.yaml

All I had to do was add the second IP next to the existing one separated with a comma like this:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
     addresses: [ 10.100.1.38/24, 10.100.1.39/24 ]
     gateway4: 10.100.1.1

Then you run:

# netplan apply

Hope this helps someone in the future.


You can do that directly on the commandline, which is not permanent (i.e. reboot-save)

sudo ifconfig eth0:0 10.100.1.40 netmask 255.255.255.0 up

or in your /etc/network/interfaces, which is permanent

sudo nano /etc/network/interfaces

add this (or similar) to the existing eth0 block

iface eth0:0 inet static
  address 10.100.1.40
  netmask 255.255.255.0

and bring it up with

sudo ifup eth0:0