5

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 Answers2

4

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.

slangasek
  • 5,828
3

To be slightly more precise, this file is created by the netinfo_to_netplan() routine, called by top-level function configure_networking in the scripts/functions file on your initrd.img. I was really hoping to find a variable I could set somewhere to disable this functionality, but I think Richard's init-bottom script from the comments above is probably the best solution.

Note you can see the script for yourself with:

mkdir /tmp/initramfs
sudo unmkinitramfs /boot/initrd.img /tmp/initramfs/
cd /tmp/initramfs/
sudo find . -type f -exec grep -il netplan {} \;
sudo less main/scripts/functions
trjh
  • 131