-
-
Notifications
You must be signed in to change notification settings - Fork 4k
systemd-networkd creates bridges with no-carrier #9252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
/cc @ssahani |
If some network set
At least currently, it seems that if no network specifies vbr0 in |
So i need to configure an unused, not required, network interface. I don't think this is the way it should work ;) (Bridges created with brctl don't have this beavior.) |
My above comment is just a 'workaround'. I could not find why the behaviors between brctl and networkd are different... |
I am trying to figure this out till netdev creation everything is same but will make this up via .network we have a difference. |
Up. Can it be resolved with #9956 ? |
@MrSorcus i don't think so. |
I am also having this problem (version 241). The networkctl state stays at |
@Rapsey Please try with disabling ipv6 link local address, that is, |
Thank you for the quick reply and fix @yuwata ! I have tested your PR on Debian 9.9 and now the link goes into a Curiously now I can't even "fix" the bridge by recreating it manually. Before this if I recreated the bridge using EDIT: After downgrading back to systemd 241 the bridges still go into NO-CARRIER even when created manually. So I suspect this was not caused by systemd directly but by updating some dependencies necessary to build from source. |
|
The original issue happens even the bridge interface is not managed by networkd.
Then, the link will be in |
It seems to depend on something else. The following was done on a VM with the exact same OS & kernel: Debian 9.9 with kernel 4.9.0-9-amd64 (4.9.168-1+deb9u2). No NO-CARRIER there.
|
Logically, I'd expect a bridge with no interfaces to be in NO-CARRIER state. What does it even mean that the bridge has "carrier" when it has no interfaces? But anyway, with systemd-242-895-g9e93200+ and kernel-5.0.7-300.fc30.x86_64, I do get "carrier" with both manual |
I'm afraid I won't be able to continue investigating this, but here's what I found. Maybe it can help someone else in the future. On a clean Debian stretch system bridges created with This resulted in the following packages being installed from testing:
After this, all interfaceless bridges created with |
@keszybz sometime you need to create a bridge without interfaces, for example to bind virtual machines or dynamic interfaces to it afterwards. |
Anyway, this is not caused by
|
I agree with @keszybz. |
Yes, I know this. I don't have have any issue with a bridge device without enslaved interfaces. I tried to follow the carrier logic in the kernel, but I couldn't figure it out. I see |
I'd prefer to keep this open until we figure out what is going on here. |
I've noticed that a bridge will initially be in the NO-CARRIER state if spanning tree is enabled, until the real interface has completed the listening and learning phases. If From dmesg:
Before
And after:
|
The preceeding comment from @ChetHosey helped me. To get connectivity back, I simply disabled STP and waited a bit. |
AFAIK a bridge should never be empty, it is not fully setup if empty. In cases interfaces get dynamically added/removed to a bridge, there should be at least one remaining. You can do this with a dummy interface always belonging to the bridge (libvirt does this, virbr0-nic dummy interface). (Would it maybe be useful to have an netdev option "DummyDevice=..." in the bridge section that automatically does that??) A bridge inherits the MAC address of its first device (or used to inherit? I was not able to reproduce it), when all devices are removed and a new one is added, it would change its MAC. This can lead to issues. So I don't know if this is a legacy problem that has changed with recent kernels or if there are still good reasons to not have an empty bridge. |
@ganguin, see #9252 (comment) re bridges with no interfaces. Bridge MAC is generated from the bridge name, and not from any devices that are attached to it. We changed that in systemd 241. See https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html#v241. |
I think I encountered this issue ... My bridges are in NO CARRIER state.
Added This issue also caused |
Completely different setup, but the same symptoms. I was able to track this down to a single
Linux 5.10 |
After further debugging, it's specifically the Similarly, adding |
FWIW: After upgrading from Ubuntu 20.04 to 22.04 same problem occurs. Fixed it with
|
Since @jelmd provided the fix I found for this issue I am commenting here. Yea it works! In my use case I was using link files to rename interfaces to wan and lan using MAC and maybe that's why this bridge link file is required. I made sure to put it lexically before the other interface link files |
If you want to get a bridge without connected interfaces working under systemd 255+ you can try adding "MACAddress=none" to the [NetDev] section of your .netdev file. I also have bridges excluded from the 99-default.link so MACAddressPolicy=persistent does not take effect by specifying "Type=!bridge" From the docs: MACAddress= Note, even if "none" is specified, systemd-udevd will assign the persistent MAC address for the device, as 99-default.link has MACAddressPolicy=persistent. So, it is also necessary to create a custom .link file for the device, if the MAC address assignment is not desired. |
systemd version the issue has been seen with
Used distribution
Expected behaviour you didn't see
Unexpected behaviour you saw
Steps to reproduce the problem
10-vbr0.netdev:
10-vbr0.network
If i delete vbr0 with
ip link delete vbr0
and create it withbrctl addbr vbr0
systemd-networkd configures the interface with settings from the .network file.Her the output of
ip link show
:Any ideas?
The text was updated successfully, but these errors were encountered: