3

So I replaced Netplan with Ifupdown as Netplan did not allow me to apply network configurations live, and I was told this is a known issue. To do this I installed ifupdown, used ip link show to see my interface names and created the following /etc/network/interfaces:

allow-hotplug eno1
iface eno1 inet dhcp

allow-hotplug eno2
iface eno2 inet dhcp

allow-hotplug enp10s0f0
iface enp10s0f0 inet static
    address 10.0.1.235
    netmask 255.255.255.0
    gateway 10.0.1.1

allow-hotplug enp10s0f1
iface enp10s0f1 inet dhcp

I'm using allow-hotplug because the system hangs at boot waiting for the network when I have some of the interfaces disconnected as I often don't use them all at the same time.

When the system boots, all connected interfaces get an IP address via DHCP, including the one I configured statically. To get the static IP address to apply, I must ifdown enp10s0f0 then ifup enp10s0f0 at which point it's fine.

If it's important, Netplan was removed with apt-get purge nplan and cloud-init with apt-get purge cloud-init.

How can I get my static configuration to work at boot?

1 Answers1

1

Unfortunately, the steps above do not completely enable the things required by ifupdown and also do not completely remove Netplan. To fix this, I followed the following instructions from https://askubuntu.com/a/1052023/946893 running the following commands as root:

systemctl unmask networking
systemctl enable networking
systemctl restart networking

systemctl stop systemd-networkd.socket systemd-networkd \
networkd-dispatcher systemd-networkd-wait-online

systemctl disable systemd-networkd.socket systemd-networkd \
networkd-dispatcher systemd-networkd-wait-online

systemctl mask systemd-networkd.socket systemd-networkd \
networkd-dispatcher systemd-networkd-wait-online

apt-get --assume-yes purge nplan netplan.io

shutdown -r now

At this point the static configuration worked on boot.

NOTE: The config was also missing dns-nameservers 1.1.1.1 1.0.0.1 under the static configuration, and as stated in the linked answer these servers must also be specified in /etc/systemd/resolved.conf then the systemd-resolved service must be restarted