Ubuntu 18.04: switch back to /etc/network/interfaces

bionic netplan do_not_use_netplan

Ubuntu 18.04: switch back to /etc/network/interfaces

Starting sometime around Ubuntu 18.04, the Ubuntu devs stopped using the classic /etc/init.d/networking and /etc/network/interfaces method of configuring the network and switched to some thing called netplan. This has made a lot of people very angry and been widely regarded as a bad move. Is it possible to remove netplan and use the correct /etc/network/interfaces method for configuring the network?

Можно запретить использование netplan на уровне ядра

Для этого надо отредактировать /etc/default/grub 

добавить netcfg/do_not_use_netplan=true как дополнительный параметр GRUB_CMDLINE_LINUX

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX="ipv6.disable=1 netcfg/do_not_use_netplan=true"


The following procedure works for Ubuntu 18.04 Bionic Beaver

I. Reinstall the ifupdown package:

# apt-get update
# apt-get install ifupdown

II. Configure your /etc/network/interfaces file with configuration stanzas such as:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

allow-hotplug enp0s3
auto enp0s3
iface enp0s3 inet static
  # Only relevant if you make use of RESOLVCONF(8)
  # or similar...

III. Make the configuration effective no reboot needed:

# ifdown --force enp0s3 lo && ifup -a
# systemctl unmask networking
# systemctl enable networking
# systemctl restart networking

IV. Disable and remove the unwanted services:

# systemctl stop systemd-networkd.socket systemd-networkd \
networkd-dispatcher systemd-networkd-wait-online
# systemctl disable systemd-networkd.socket systemd-networkd \
networkd-dispatcher systemd-networkd-wait-online
# systemctl mask systemd-networkd.socket systemd-networkd \
networkd-dispatcher systemd-networkd-wait-online
# apt-get --assume-yes purge nplan netplan.io

Then, you're done.

Note: You MUST, of course, adapt the values according to your system network, interface name....

V. DNS Resolver

Because Ubuntu Bionic Beaver 18.04 make use of the DNS stub resolver as provided by SYSTEMD-RESOLVED.SERVICE8, you SHOULD also add the DNS to contact into the /etc/systemd/resolved.conf file. For instance:


and then restart the systemd-resolved service once done:

# systemctl restart systemd-resolved

The DNS entries in the ifupdown INTERFACES5 file, as shown above, are only relevant if you make use of RESOLVCONF8 or similar.


Пример netplan конфига сети:

cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
  version: 2
  renderer: networkd
      dhcp4: no
      addresses: []
        addresses: [,]