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)
networking.useNetworkd = true;networking.bridgesnixos-rebuild switch and see report about failed unitClosing 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…
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.servicetaking forever like this:In my case, bond1 with enslaved eno1 and eno2, then some vlan interfaces on top of bond1:
Let me know if that helps!