1

I have a system with an encrypted root. I have installed dropbear-initramfs and am able to SSH in and unlock root and boot fine. However once I boot I end up with both eth0 and br0 with the same static IP and thus networking is not functioning.

Running ifconfig eth0 0.0.0.0 gets everything going after boot, but I want to avoid having to load that in at boot as it feels very hacky. Looking for how to get initramfs to reset/cleardown/etc the eth0 interface to allow netplan to apply once the main system kernel boots.

The IP for initramfs is configured in /etc/initramfs-tools/initramfs.conf as follows IP=”192.168.1.220:::255.255.255.0::eth0:off”

Netplan config

  ethernets:
    eth0:
      dhcp4: no
  bridges:
    br0:
      interfaces: [eth0]
      dhcp4: no
      addresses:
      - 192.168.1.220/24
      gateway4: 192.168.1.1
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
        search:
        - teese.net.au
  version: 2

I have tried setting IFDOWN=* in /etc/dropbear-initramfs/config to no avail.

Any tips would be appreciated. Cheers

Jason
  • 85

1 Answers1

4

If you are using Ubuntu 20.04 like me, you will find a file /run/netplan/eno1.yaml (or similar file) created after booting.

You can add a script under /etc/initramfs-tools/scripts/init-bottom/ like this:

rm -f /run/netplan/eno1.yaml

to delete the IP address configuration you specified in /etc/initramfs-tools/initramfs.conf

See this related question: What is creating /run/netplan/eth0.yaml?

Jim Lin
  • 88