/etc/network/interfaces, systemd-networkd and NetworkManager: how do they coexist together?

As you might know /etc/network/interfaces has been replaced with netplan. And netplan works fine with both NetworkManager and systemd-networkd.

So you can have them all work together!

If you're running Ubuntu as your desktop, then you should use NetworkManager or config netplan so it uses NetworkManager as its default renderer:

network:
  version: 2
  renderer: NetworkManager

Otherwise you can easily setup your interfaces in netplan itself, for example to have interfaces like configuration and network-manager work together:

network:
  version: 2
  renderer: NetworkManager
  wifis:
    wlp4s0:
      dhcp4: yes
      access-points:     
        my-access-point:
          password: passw00rd
network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      addresses:
        - 192.168.1.10/24
      dhcp4: false
      dhcp6: false
      gateway4: "192.168.1.1"
      nameservers:
        addresses:
          - "8.8.4.4"
          - "8.8.8.8"

Configuration

To configure netplan, save configuration files under /etc/netplan/ with a .yaml extension (e.g. /etc/netplan/config.yaml), then run sudo netplan apply. This command parses and applies the configuration to the system. Configuration written to disk under /etc/netplan/ will persist between reboots.

Netplan configuration examples


Replacing netplan with ifupdown is still possible but something that I wouldn't suggests.

  1. Install ifupdown
  2. Remove netplan
  3. Configure interfaces
  4. Configure /etc/NetworkManager/NetworkManager.conf so it would be able to manage your interfaces.
  5. Restart networking services

You can even run dhclient directly to bring an interface up.