You are not logged in.

#1 2025-02-08 22:57:30

erikvv
Member
Registered: 2013-05-06
Posts: 10

systemd-networkd link not added to bridge

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
What I've checked

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

Context

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

#2 2025-02-09 16:39:52

Beemo
Member
Registered: 2024-12-20
Posts: 50

Re: systemd-networkd link not added to bridge

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

#3 2025-02-09 21:20:32

erikvv
Member
Registered: 2013-05-06
Posts: 10

Re: systemd-networkd link not added to bridge

Beemo wrote:

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

#4 2025-02-09 22:19:38

erikvv
Member
Registered: 2013-05-06
Posts: 10

Re: systemd-networkd link not added to bridge

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

#5 2025-02-10 06:48:26

Beemo
Member
Registered: 2024-12-20
Posts: 50

Re: systemd-networkd link not added to bridge

erikvv wrote:

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

Board footer

Powered by FluxBB