2

Something is creating /run/netplan/eth0.yaml at boot and I can't figure out what it is. (I'm running 18.04 Bionic Beaver.) That file is causing eth0 to be managed by systemd-networkd but I want it to be managed by NetworkManager. Is there a udev rule or systemd service somewhere that is creating that file? I looked at the source code for netplan and it doesn't appear capable of generating /run/netplan/*.yaml files itself (it only reads them).

Contents of /run/netplan/eth0.yaml:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      match:
        macaddress: "xx:xx:xx:xx:xx:xx"
      set-name: eth0
      dhcp4: true
      dhcp-identifier: mac
      critical: true
      nameservers:
        addresses: ["192.168.0.1"]
        search: ["example.com"]
2

This file is created by initramfs-tools when you pass network configuration options to your system on the kernel command line, such as when using NFS or iSCSI or when configuring ssh in the initramfs for remote cryptsetup unlocking.

You should be able to override to set renderer: NetworkManager in a file sorting lexically after eth0.yaml and redirect this network interface to NetworkManager that way.

| improve this answer | |
  • Yup, I have "ip=dhcp" in my kernel command-line so that I can unlock my encrypted drives from remote by sshing into dropbear. My root filesystem is not on the network so there's no need to keep networking up during the boot. – Richard Hansen Apr 19 at 20:18
  • ok. You should be able to override to set renderer: NetworkManager in a file sorting lexically after 'eth0.yaml' and redirect this network interface to NetworkManager that way. – slangasek Apr 20 at 21:40
  • Thanks for the hint. I ended up creating /etc/initramfs-tools/scripts/init-bottom/deconfigure-interfaces that does rm -f /run/netplan/eth0.yaml && ip -f inet address flush dev eth0. (I don't know if flushing the IP addresses is necessary, but it doesn't hurt.) – Richard Hansen Apr 25 at 2:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.