Comment 11 for bug 1863873

Revision history for this message
Dan Streetman (ddstreet) wrote :

> lxc.net.0.ipv4.gateway = 192.168.252.1
> lxc.net.0.ipv4.address = 192.168.252.171/32

> 3. inside the container, deactivate dhcp (dhcp4: false )in `/etc/netplan/10-lxc.yaml`,

ok, this is your problem; you're misconfiguring the instance. Unfortunately, you were just 'lucky' that it worked before, but this is absolutely intended behavior of systemd: when you tell it to manage an interface, it expects to control 100% of the interface's addresses and routing (with the minor exception that newer systemd has added 'KeepConfiguration' config for specific situations where externally-configured networking should be kept on the interface, such as some HA setups).

Your problem here is that you're configuring the interface networking *outside* networkd, but then also telling networkd it should manage the interface. It's fine to use lxc to externally configure the interface networking, but then inside the container you must make sure networkd does not think it's managing eth0, which means you must completely remove the 'eth0' section inside the netplan config yaml - if you leave any 'eth0' config there at all, it will create a network file telling networkd that it should manage eth0, even though it's not assigning any ipv4 addresses (it does setup ipv6 link-local by default, however). The file that netplan creates for the eth0 interface will be /run/systemd/network/10-netplan-eth0.network.

You can see in the output of networkctl:

root@bionic:/# networkctl list
IDX LINK TYPE OPERATIONAL SETUP
  1 lo loopback carrier unmanaged
 29 eth0 ether degraded configured

since in your use case you do not use (or want!) networkd to manage eth0, you want the 'SETUP' column to show 'unmanaged', not 'configured'.

What you need to do is, instead of simply changing the netplan eth0 dhcp4 configuration to false, you need to remove the eth0 section completely. If that's the only section you have, you'll need to remove the entire 'ethernets' section, or just remove the yaml file entirely (or rename it to anything that doesn't end in '.yaml').

Then, when you 'netplan apply' or reboot, you should notice that the /run/systemd/network/ file for eth0 is no longer created, and networkd no longer thinks it manages eth0, and your externally-configured eth0 networking should work again.

I hope this works for you, and very sorry for the disruption of your production environment.