You are not logged in.
I have a network file like below. The link is not added to the bridge.
# /etc/systemd/network/45-vethswarmlxc.network
[Match]
Name=vethswarmlxc
[Network]
Bridge=lxcbr0
1. The file matches the link and there are no errors:
journalct --unit systemd-networkd
Feb 08 23:17:46 hetzner3 systemd-networkd[49104]: vethswarmlxc: Configuring with /etc/systemd/network/45-vethswarmlxc.network.
Feb 08 23:17:46 hetzner3 systemd-networkd[49104]: vethswarmlxc: Link UP
Feb 08 23:17:48 hetzner3 systemd-networkd[49104]: vethswarmlxc: Gained carrier
2. It works when I attach the bridge manually
ip link set vethswarmlxc master lxcbr0
ip addr show dev vethswarmlxc
22: vethswarmlxc@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master lxcbr0 state UP group default qlen 1000
link/ether 42:e6:e7:4f:46:d8 brd ff:ff:ff:ff:ff:ff link-netnsid 5
3. Restarting systemd-networkd, rebooting the system
4. removing and recreating the interface
The link is a veth which is on the host side, connected to a systemd-nspawn container. It is the second veth of this container. It is created by a .nspawn file using
VirtualEthernetExtra=vethswarmlxc:cethswarmlxc
The bridge is the standard bridge created by LXC.
It seems like this should work and I'm missing something obvious.
Last edited by erikvv (2025-02-09 21:46:37)
Offline
Does it say "unmanaged" in "networkctl status"?
Also systemd-nspawn says:
Note that --network-bridge= has no effect on interfaces created with --network-veth-extra=.
Last edited by Beemo (2025-02-09 16:46:17)
Offline
Does it say "unmanaged" in "networkctl status"?
Yes for the interface. Should the bridge lxcbr0 be managed?
# networkctl
IDX LINK TYPE OPERATIONAL SETUP
...
3 lxcbr0 bridge routable unmanaged
4 br0 bridge routable configured
...
21 vb-swarm ether enslaved configured
22 vethswarmlxc ether enslaved configured
Also systemd-nspawn says:
Note that --network-bridge= has no effect on interfaces created with --network-veth-extra=.
I'm aware. I'm using --network-bridge=, which creates the vb-swarm link.
Offline
I've tested with a third bridge (br1) and that works. So it is something specific to the LXC-managed bridge lxcbr0. I think my best course of action is to replace this bridge with a systemd-networkd managed bridge. I want to migrate away from LXC anyway.
Last edited by erikvv (2025-02-09 22:21:42)
Offline
Yes for the interface. Should the bridge lxcbr0 be managed?
Nah, in theory just the veth interface.
My other guess would be that the bridge lxcbr0 comes up after vethswarmlxc is configured, but it seems unlikely since restarting sd-networkd didn't work.
Last edited by Beemo (2025-02-10 09:08:47)
Offline