Nixpkgs: [NixOS] systemd-networkd-wait-online.service fails with bridge interfaces configured

Created on 28 Oct 2017  Â·  4Comments  Â·  Source: NixOS/nixpkgs

Issue description

This issue is related to https://github.com/systemd/systemd/issues/2154

Systemd configured bridge make systemd-networkd-wait-online.service fail because the participating interfaces remain in configuring state for ever (and the unit times out).

In NixOS, this is particularly troubling has it make nixos-rebuild fail (because the unit remains in failed state). Also, this unit provide the network-online.target which is critical for starting network services (e.g. sshd).

A workaround for this is to add --ignore flags to ${config.systemd.package}/lib/systemd/systemd-networkd-wait-online with interfaces that participate in a bridge (using contents of networking.bridges for example or filtering interfaces that contain Bridge= network directive in systemd.networks)

Steps to reproduce

  1. Configure nixos to use systemd-networkd networking.useNetworkd = true;
  2. Declare bridge in networking.bridges
  3. Execute nixos-rebuild switch and see report about failed unit

Technical details

  • System: NixOS 17.09.1756.c99239bca0 (Hummingbird)
  • Nix version: nix-env (Nix) 1.11.15
  • Nixpkgs version: "17.09.1756.c99239bca0"
  • Sandboxing enabled: build-use-sandbox = false

Most helpful comment

@netixx I guess I now understand the whole point of why you wanted to disable IPv6 bits in https://github.com/NixOS/nixpkgs/pull/35841 - for some reason, disabling IPv6 seemed to workaround the problem described here: https://github.com/systemd/systemd/issues/9077

Disabling IPv6 was not an option for me, but I do workaround systemd-networkd-wait-online.service taking forever like this:

In my case, bond1 with enslaved eno1 and eno2, then some vlan interfaces on top of bond1:

systemd.services.systemd-networkd-wait-online.serviceConfig.ExecStart = [
  "" # clear old command
  "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online --ignore eno1 --ignore eno2"
];

Let me know if that helps!

All 4 comments

Closing as support for IPv4 only networks is not a upstream priority at the moment.

@netixx I guess I now understand the whole point of why you wanted to disable IPv6 bits in https://github.com/NixOS/nixpkgs/pull/35841 - for some reason, disabling IPv6 seemed to workaround the problem described here: https://github.com/systemd/systemd/issues/9077

Disabling IPv6 was not an option for me, but I do workaround systemd-networkd-wait-online.service taking forever like this:

In my case, bond1 with enslaved eno1 and eno2, then some vlan interfaces on top of bond1:

systemd.services.systemd-networkd-wait-online.serviceConfig.ExecStart = [
  "" # clear old command
  "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online --ignore eno1 --ignore eno2"
];

Let me know if that helps!

I used this for a while, but it was not really practical (especially when adding or removing interfaces). Also, if a service really depends on network, this may lead the service to fail.

I use this now (which is more adequate for fixing the specific ipv6 issue):

  systemd.network.networks = mkIf (!config.networking.enableIPv6) (mapAttrs' (name: value: nameValuePair ("40-${name}") ({ networkConfig.IPv6AcceptRA = "no"; networkConfig.LinkLocalAddressing = "no";}) ) config.networking.interfaces);

Well, this will only work by disabling IPv6 on the machine in question, something I don't want to do anymore in 2018 ;-)

IPv6AcceptRA and LinkLocalAddressing being the two components triggering the interface to not become "configured" in networkd is interesting - I would have assumed eth0 with a vlan child interface would also not become "configured", as networkd would wait for a DHCP lease on eth0…

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomberek picture tomberek  Â·  3Comments

chris-martin picture chris-martin  Â·  3Comments

edolstra picture edolstra  Â·  3Comments

ob7 picture ob7  Â·  3Comments

teto picture teto  Â·  3Comments