How to enable netplan on ubuntu server upgraded from 16.04 to 18.04

If you are upgrading to 18.04 and want to use netplan instead of ifupdown, then you should do the following:

  1. make sure you have a way to access your server if the network goes down
  2. make sure the package netplan.io is installed (it should be on 18.04).
  3. create a netplan yaml according to your config. There are many examples to choose from.
  4. sudo netplan apply
  5. sudo apt purge ifupdown
  6. Reboot
  7. You should now be "migrated", and networkctl, ip addr, etc, should show your interfaces.

Note, there will still be cruft in /etc/network/. You can remove/archive:

  • /etc/network/interfaces
  • /etc/network/interfaces.d/

The rest are "hook" directories, that other packages put files in that try to react to the network state of the system. These files should be left alone.

If you have any files that you have put in there, these same facilities are better done by integrating into systemd unit files, or by using networkd-dispatcher. See more on the netplan FAQ.