[Bug 2036127] Re: Restarting `systemd-networkd` looses unmanaged bridged parents
Simon Déziel
2036127 at bugs.launchpad.net
Fri Feb 23 21:25:45 UTC 2024
@enr0n, the proposal to add:
bridges:
br0:
interfaces: [vlan1]
To the network config defeats the purpose. The goal is to not have to do
double configuration. The bridge is define in LXD, the vlan1 only in
netplan.
The other proposed fix of `KeepMaster=true` snippet in
/etc/systemd/network/10-netplan-vlan1.network.d/keep_master.conf didn't
work for me. I also tried putting it in 99-netplan-vlan1.network.d to
match the name of my netplan .yaml but still didn't work.
root at networkd-bug:~# cat /etc/netplan/99-vlan1.yaml
network:
version: 2
vlans:
vlan1:
id: 1
link: eth0
root at networkd-bug:~# cat /etc/systemd/network/99-netplan-vlan1.network.d/keep_master.conf
[Network]
KeepMaster=true
root at networkd-bug:~# grep -n . /run/systemd/network/*vlan1*
/run/systemd/network/10-netplan-vlan1.netdev:1:[NetDev]
/run/systemd/network/10-netplan-vlan1.netdev:2:Name=vlan1
/run/systemd/network/10-netplan-vlan1.netdev:3:Kind=vlan
/run/systemd/network/10-netplan-vlan1.netdev:5:[VLAN]
/run/systemd/network/10-netplan-vlan1.netdev:6:Id=1
/run/systemd/network/10-netplan-vlan1.network:1:[Match]
/run/systemd/network/10-netplan-vlan1.network:2:Name=vlan1
/run/systemd/network/10-netplan-vlan1.network:4:[Network]
/run/systemd/network/10-netplan-vlan1.network:5:LinkLocalAddressing=ipv6
/run/systemd/network/10-netplan-vlan1.network:6:ConfigureWithoutCarrier=yes
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2036127
Title:
Restarting `systemd-networkd` looses unmanaged bridged parents
Status in systemd package in Ubuntu:
Invalid
Bug description:
My home network comprises many VLANs managed by `systemd-
networkd`/`netplan`. Those VLANs are then used as parent interfaces
for LXD networks. Whenever `systemd-networkd` is restarted (i.e: post-
update), my whole network breaks because all the unmanaged bridges
lose their parent devices. Another way to see it is that `systemd-
networkd` undoes the `master` setting of those VLAN devices.
Here is a simplified reproducer:
1. Create a `vlan1` device
$ lxc launch ubuntu:22.04 networkd-bug
Creating networkd-bug
Starting networkd-bug
$ lxc file push - networkd-bug/etc/netplan/99-vlan1.yaml << EOF
network:
version: 2
vlans:
vlan1:
id: 1
link: eth0
EOF
$ lxc exec networkd-bug -- netplan apply
2. Manually create a bridge and join `vlan1` to it
$ lxc exec networkd-bug -- ip link add br0 type bridge
$ lxc exec networkd-bug -- ip link set vlan1 master br0
$ lxc exec networkd-bug -- ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: vlan1 at eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP mode DEFAULT group default qlen 1000
link/ether 00:16:3e:94:6e:47 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 42:b6:31:01:47:9a brd ff:ff:ff:ff:ff:ff
164: eth0 at if165: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:16:3e:94:6e:47 brd ff:ff:ff:ff:ff:ff link-netnsid 0
3. Restart `systemd-networkd`
$ lxc exec networkd-bug -- systemctl restart systemd-networkd
4. Notice `vlan1` lost it's master config
$ lxc exec networkd-bug -- ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: vlan1 at eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:16:3e:94:6e:47 brd ff:ff:ff:ff:ff:ff
3: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 42:b6:31:01:47:9a brd ff:ff:ff:ff:ff:ff
164: eth0 at if165: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:16:3e:94:6e:47 brd ff:ff:ff:ff:ff:ff link-netnsid 0
Ideally, `vlan1` should retain it's `master` setting and I wouldn't loose connectivity :)
Additional information:
# apt-cache policy systemd netplan.io iproute2
systemd:
Installed: 249.11-0ubuntu3.9
Candidate: 249.11-0ubuntu3.9
Version table:
*** 249.11-0ubuntu3.9 500
500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
100 /var/lib/dpkg/status
249.11-0ubuntu3.7 500
500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
249.11-0ubuntu3 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
netplan.io:
Installed: 0.105-0ubuntu2~22.04.3
Candidate: 0.105-0ubuntu2~22.04.3
Version table:
*** 0.105-0ubuntu2~22.04.3 500
500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
100 /var/lib/dpkg/status
0.104-0ubuntu2 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
iproute2:
Installed: 5.15.0-1ubuntu2
Candidate: 5.15.0-1ubuntu2
Version table:
*** 5.15.0-1ubuntu2 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
100 /var/lib/dpkg/status
# lsb_release -rd
Description: Ubuntu 22.04.3 LTS
Release: 22.04
# uname -a
Linux networkd-bug 6.2.0-32-generic #32~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 18 10:40:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2036127/+subscriptions
More information about the foundations-bugs
mailing list