Skip to content
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

systemd-networkd-wait-online fails with bridged interfaces #2154

Open
mrschyte opened this Issue Dec 13, 2015 · 7 comments

Comments

7 participants
@mrschyte
Copy link

mrschyte commented Dec 13, 2015

I have a setup where several vlans are created and all interfaces are parts of different bridges.
Unfortunately the wait online binary fails to detect that the network is up in this case.

Error message in journal:

Failed to start Wait for Network to be Configured.

I suspect that this is caused by the binary calling the "manager_all_configured" function which returns true only when the operational state for a link is degraded or routable, however in my case the state is in "carrier".

I've tried to call systemd-networkd-wait-online when the system was already up with the "-i IFACE" flag for each interface, but no matter what interface is specified, the utility waits until the timeout has been reached.

@mrschyte

This comment has been minimized.

Copy link
Author

mrschyte commented Dec 13, 2015

The interface are setup similarly to this:

int.network:

[Match]
Name=eth*

[Network]
VLAN=lan0

lan.network:

[Match]
Name=lan*

[Network]
Bridge=brlan0

lan.netdev:

[NetDev]
Name=lan0
Kind=vlan

[VLAN]
Id=7

@poettering poettering added the network label Dec 23, 2015

@juhokuu

This comment has been minimized.

Copy link

juhokuu commented Sep 14, 2016

Happens here too: systemd-networkd-wait-online will not detect network on a bridge interface and times out. However, it does work as expected if I boot with ipv6.disable=1. In both cases, the logs show the bridge gaining a carrier. I'm on v231.

My /etc/systemd/network is:

enp1s0.network

[Match]
Name=enp1s0

[Network]
Bridge=br1

br1.netdev

[NetDev]
Name=br1
Kind=bridge

br1.network

[Match]
Name=br1

[Network]
DHCP=ipv4

Systemd-networkd.service and systemd-networkd-wait-online.service in the absence of ipv6.disable=1:

Sep 14 17:06:15 crossbeam systemd[1]: Starting Wait for Network to be Configured...
Sep 14 17:06:15 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:15 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:15 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:15 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:15 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:18 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:18 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:18 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:18 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:18 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:18 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:18 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:18 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:22 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:23 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:06:33 crossbeam systemd-networkd-wait-online[274]: ignoring: lo
Sep 14 17:08:15 crossbeam systemd[1]: systemd-networkd-wait-online.service: Main process exited, code=exited, status=1/FAILURE
Sep 14 17:08:15 crossbeam systemd[1]: Failed to start Wait for Network to be Configured.
Sep 14 17:08:15 crossbeam systemd[1]: systemd-networkd-wait-online.service: Unit entered failed state.
Sep 14 17:08:15 crossbeam systemd[1]: systemd-networkd-wait-online.service: Failed with result 'exit-code'.
Sep 14 17:06:14 crossbeam systemd[1]: Starting Network Service...
Sep 14 17:06:15 crossbeam systemd-networkd[262]: br1: netdev ready
Sep 14 17:06:15 crossbeam systemd-networkd[262]: Enumeration completed
Sep 14 17:06:15 crossbeam systemd[1]: Started Network Service.
Sep 14 17:06:15 crossbeam systemd-networkd[262]: enp1s0: Renamed to eth0
Sep 14 17:06:15 crossbeam systemd-networkd[262]: eth0: Renamed to enp1s0
Sep 14 17:06:15 crossbeam systemd-networkd[262]: br1: IPv6 enabled for interface: Success
Sep 14 17:06:15 crossbeam systemd-networkd[262]: br1: Could not append VLANs: Operation not permitted
Sep 14 17:06:15 crossbeam systemd-networkd[262]: br1: Failed to assign VLANs to bridge port: Operation not permitted
Sep 14 17:06:15 crossbeam systemd-networkd[262]: br1: Could not set bridge vlan: Operation not permitted
Sep 14 17:06:15 crossbeam systemd-networkd[262]: enp1s0: IPv6 disabled for interface: Success
Sep 14 17:06:15 crossbeam systemd-networkd[262]: enp1s0: Could not append VLANs: Operation not permitted
Sep 14 17:06:15 crossbeam systemd-networkd[262]: enp1s0: Failed to assign VLANs to bridge port: Operation not permitted
Sep 14 17:06:15 crossbeam systemd-networkd[262]: enp1s0: Could not set bridge vlan: Operation not permitted
Sep 14 17:06:18 crossbeam systemd-networkd[262]: enp1s0: Gained carrier
Sep 14 17:06:18 crossbeam systemd-networkd[262]: br1: Gained carrier
Sep 14 17:06:18 crossbeam systemd-networkd[262]: br1: DHCPv4 address 192.168.0.104/24 via 192.168.0.1
Sep 14 17:06:19 crossbeam systemd-networkd[262]: br1: Gained IPv6LL
Sep 14 17:06:23 crossbeam systemd-networkd[262]: br1: Configured

And when booted with ipv6.disable=1

Sep 14 17:10:28 crossbeam systemd[1]: Starting Wait for Network to be Configured...
Sep 14 17:10:28 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:28 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:28 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:28 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:28 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:28 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd-networkd-wait-online[270]: ignoring: lo
Sep 14 17:10:31 crossbeam systemd[1]: Started Wait for Network to be Configured.
Sep 14 17:10:28 crossbeam systemd[1]: Starting Network Service...
Sep 14 17:10:28 crossbeam systemd-networkd[257]: br1: netdev ready
Sep 14 17:10:28 crossbeam systemd-networkd[257]: Enumeration completed
Sep 14 17:10:28 crossbeam systemd[1]: Started Network Service.
Sep 14 17:10:28 crossbeam systemd-networkd[257]: enp1s0: Renamed to eth0
Sep 14 17:10:28 crossbeam systemd-networkd[257]: eth0: Renamed to enp1s0
Sep 14 17:10:28 crossbeam systemd-networkd[257]: br1: Cannot disable IPv6 for interface br1: No such file or directory
Sep 14 17:10:28 crossbeam systemd-networkd[257]: br1: Could not append VLANs: Operation not permitted
Sep 14 17:10:28 crossbeam systemd-networkd[257]: br1: Failed to assign VLANs to bridge port: Operation not permitted
Sep 14 17:10:28 crossbeam systemd-networkd[257]: br1: Could not set bridge vlan: Operation not permitted
Sep 14 17:10:28 crossbeam systemd-networkd[257]: enp1s0: Cannot disable IPv6 for interface enp1s0: No such file or directory
Sep 14 17:10:28 crossbeam systemd-networkd[257]: enp1s0: Could not append VLANs: Operation not permitted
Sep 14 17:10:28 crossbeam systemd-networkd[257]: enp1s0: Failed to assign VLANs to bridge port: Operation not permitted
Sep 14 17:10:28 crossbeam systemd-networkd[257]: enp1s0: Could not set bridge vlan: Operation not permitted
Sep 14 17:10:28 crossbeam systemd-networkd[257]: enp1s0: Configured
Sep 14 17:10:31 crossbeam systemd-networkd[257]: enp1s0: Gained carrier
Sep 14 17:10:31 crossbeam systemd-networkd[257]: enp1s0: Configured
Sep 14 17:10:31 crossbeam systemd-networkd[257]: br1: Gained carrier
Sep 14 17:10:31 crossbeam systemd-networkd[257]: br1: DHCPv4 address 192.168.0.104/24 via 192.168.0.1
Sep 14 17:10:31 crossbeam systemd-networkd[257]: br1: Configured
@enihcam

This comment has been minimized.

Copy link

enihcam commented Feb 4, 2017

Same issue here.
I would suggest that, a virtual interface should be 'configured' as long as it has an IP.

@TCB13

This comment has been minimized.

Copy link

TCB13 commented Sep 8, 2017

Same problem here. It should be able to inspect if the bridge is working the same way it does with physical connections.

@bobrik

This comment has been minimized.

Copy link

bobrik commented Oct 13, 2017

Seeing the same failure, but with bonded interface. If I exclude bond slaves, command succeeds:

$ /lib/systemd/systemd-networkd-wait-online --timeout 3 --ignore eth2 --ignore eth3; echo $?
ignoring: eth3
ignoring: eth2
ignoring: lo
0

I have carrier on bond0 that is eth2+eth3.

@mrschyte

This comment has been minimized.

Copy link
Author

mrschyte commented Aug 26, 2018

This has been open for a long time now, so I've decided to write a simple workaround script which is available at https://gist.github.com/mrschyte/aa83ddad3c1d4f46308c6bb0a555af44

To set it up run systemctl edit systemd-networkd-wait-online.service and add the following lines:

[Service]                                                                                                     
ExecStart=
ExecStart=/usr/local/bin/wait-online.py brlan0 brdmz0 eth0 eth1 ppp0

Don't forget to add / change the interfaces. Cheers!

@alitvak69

This comment has been minimized.

Copy link

alitvak69 commented Sep 10, 2018

The problem that I see not addressed is the one where you are not configuring IP addresses on purpose.
In my case Opennebula, OpenStack, nomad hosts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.