12

Is it sufficient to have one of these three in Ubuntu 19.04? Is it possible to have all three and how to configure them so they were not conflicting?

Does systemd-networkd started by networking.service?

Fabby
  • 34,259
midenok
  • 792
  • 1
  • 8
  • 13
  • @Fabby, 19.04. But this is general question (so imply latest version). The question is more appropriate for U&L, but I guessed AU is larger community. – midenok Jul 27 '19 at 20:54

1 Answers1

8

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.

Ravexina
  • 55,668
  • 25
  • 164
  • 183
  • Where is netplan configured? You list a lot of configuration options but not where they go. – Seth Aug 20 '19 at 04:49