Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
systemd-networkd-wait-online: Wait ALL links to gain a carrier #2037
Comments
ohsix
commented
Nov 26, 2015
|
what constitutes the network being 'up' is poorly defined, mostly http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ if you have a more specific / better way to signal that your network is 'online', you can make it do what NetworkManager-wait-online.service for network-online.target |
Is IPv6 managed by networkd? |
TCB13
commented
Nov 26, 2015
|
@ohsix and @arvidjaar I'm using
It really looks like systemd-networkd-wait-online is not waiting for the IPv6 addresses to be online and routable since it already has an IPv4 link working. => I guess this could be expected since But how can I make sure it waits until all IPs are there, routable and working properly? Thank you. |
poettering
added
RFE
network
labels
Nov 26, 2015
Slair1
commented
Mar 15, 2016
|
I have this same problem, my services are starting and failing because my IPv6 address is not yet up, even though they wait for network-online |
TCB13
commented
Jul 3, 2016
•
|
I managed to find out that this issue is related to IPv6 DAD. Some race condition described here: https://www.agwa.name/blog/post/beware_the_ipv6_dad_race_condition. Basically white DAD is still running no program can bind to a specific IPv6 address. If you try to bind at that time, they will fail. Disabling DAD for the interface fixes the issue:
However this is a quick fix, I would like to see DAD working properly with |
tchernomax
referenced this issue
Jul 31, 2016
Closed
`systemd-networkd-wait-online -i x` doesn't wait for x to be fully configured #3844
Frederick888
commented
Sep 25, 2016
|
I experienced this issues as well. I am using a VPS and it is assigned with an IPv6 pool so I added specific addresses manually in
And my Nginx and Dovecot failed to bind IPv6 address on boot... I fixed it by appending |
|
I am also having this issue, and also only using systemd-networkd (on Ubuntu Xenial) Here is enough detail for someone to fix it: This is happening because systemd-networkd-wait-online completes even though IPv6 address are still in the tentative state (ie DAD is ongoing): For instance at the moment of failure 'ip addr' says this:
The above is showing an interface that got an IPv4 address via DHCP, and an IPv6 address via radv. However DAD is ongoing and the IPv6 address is marked 'tentative'. Those addresses cannot be used for much in Linux. The first thing to fix is to have systemd-networkd-wait-online wait until all IPv6 addresses leave the tentative state (check ifa_flags for IFA_F_TENTATIVE), that would at least cover off cases where networkd itself sets static IPv6 addresses, and make the radvd & dhcp case more likely to work. The second fix is to enhance networkd to know what addresses to expect (add DHCP=both?) and have systemd-networkd-wait-online wait until all expected dynamic address configuration completes. This is a huge PITA for NFS, where I need NFS mounts to not start until the IPv6 network actually works, otherwise systemd tries the mount once, fails the mount, and then breaks the boot. |
|
This seems fixed in v232 at least. It looks like fe30727 largely took care of it. The 'address_is_ready' check in 'link_check_ready' does check that the radv address is !tentative, and that does block systemd-network-online. v289 (Xenial) does not work. I think this can be closed. |
|
Thanks for checking again! Closing then. |
martinpitt
closed this
Jan 9, 2017
koenpunt
commented
Mar 19, 2017
@jgunthorpe what did you mean with that? Should I assume this isn't fixed on Ubuntu Xenial, and that I have to disable DAD? |
|
@koenpunt my testing showed it isn't fixed on Xenial and IPv6 is not reliably working before network-online |
braiam
commented
Apr 1, 2017
|
Here's the tracking bug for Xenial/Yakkety https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1673092 |
braiam
commented
Jun 21, 2017
|
Is there a patch for backporting this fix? @jgunthorpe comment says that commit fe30727 took care of it, but the commit doesn't make reference to |
TCB13 commentedNov 26, 2015
Hello,
According to documentation
systemd-networkd-wait-onlineworks as follows:Is there any specific reason why
and for at least one link to gain a carrierisn't actuallyand ALL links to gain a carrier. It looks like the current methodology has issues if we've multiple IPv4 and IPv6 links (IPs) on the same interface.systemd-networkd-wait-onlineseems to stop waiting as soon as ONE link (IP) is assigned/online and the network is working.Is there a way it's behavior can be configured to wait for all links to be online? Otherwise this can end up in binding issues at other services because some specific IP is not available to bind but
network-online.targetwas reached.Example, I set two units that start after
network-online.targetand one pings an host over IPv4 the other one over IPv6 and the following happens.IPv4 Test Result:
IPv6 Test Result:
As you can see the IPv4 network is working perfectly after boot, however IPv6 is not ready yet, so
ping6and all boot processes that need IPv6 fail do bind.Before someone asks if my networking is properly setup, if I SSH to the machine right after the boot and try to run the same
ping6command everything works fine. It really looks likesystemd-networkd-wait-onlineis not waiting for the IPv6 addresses to be online and routable since it already has an IPv4 link working.Thank you.