-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Enable networkd by default #202488
Enable networkd by default #202488
Conversation
This results in a more sensible behaviour for common setups, such as workstations with both WiFi and Ethernet interfaces where only one needs to be connected for online status to be reached -- which is exactly the scenario useDHCP is for. This also allows simplifying the config generated by the installer: we don't need per-interface declarations at all anymore.
The example is outdated, as NixOS's networking options have supported static IPv6 configuration for a long time now. With networkd being enabled by default, networking.localCommands loses further relevance and should only be used in extremely niche use cases -- and certainly not encouraged for use cases as common as setting IPv6 addresses.
Since networkd is now enabled by default, we no longer need to enable it explicitly.
@@ -74,6 +74,7 @@ in | |||
enable = true; | |||
} | |||
(mkIf cfg.useDHCP { | |||
wait-online.anyInterface = lib.mkDefault true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I frequently see problems with wait-online timing out already because it tracks to many interfaces. Wouldn't this make this worse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this does the exact opposite. Its just waits for any of the interfaces to come online.
db893db
to
f9dfb49
Compare
super stoked for this! I have been using the networkd backend for a while now and it is rock solid. Might be worth adding some docs about how |
@danielbarter yes, that would be great! If you want to pair at some point to get this moving again let me know, I'm |
👍. Should have some time next weekend. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/california-bay-area-meetup-nix-20th/26553/3 |
Really looking forward to have this in 23.11. Had much better experience with |
The tests for kea and networkd-prefix-delegation rely on networkd only, so I expect them to be fine. |
@@ -7,6 +7,9 @@ let | |||
{ ... }: | |||
{ services.cjdns.enable = true; | |||
|
|||
# Occupies port 53 otherwise | |||
services.resolved.enable = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CJDNS is actually unrelated to DNS (at least in a direct sense), this shouldn't be necesarry
I'm also excited for networkd, but to temper the enthusiasm above: I have been trying to switch my systems to networkd for about a week now and haven't yet succeeded. I will keep opening PRs and issues as I discover details, but to briefly list what I've been running into:
Some of these are issues we can fix in nixpkgs, while others are footguns that users should be made aware of prominently in the release notes. Since there could be myriad problems for existing users, would it make sense to start by enabling |
switching doesn't work: this is a known issue and I don't think it's something we should invest much effort into improving (though it might be worth detecting this and cancelling a switch). Systems should be rebooted on a regular basis to ensure they're running recent kernels anyway, and upgrading to a new release is generally expected to require a reboot. silly configuration: some good catches there, thanks! containers: maybe @Ma27 knows something relevant? services on port 53: these problems are exposed by many of the tests, which is why I put a big checklist in the description and some discussion on here about what the best way to deal with that is. |
Yes, detecting and cancelling would help if there aren't plans to support it. It's not only an issue for release (where as you say, a reboot is expected) but also in case users want to make the switch sometime before or after the release. The issue with a required reboot isn't one reboot, but the potentially many reboots and loss-of-connectivity events that come with troubleshooting the switch to networkd.
👍 I don't see a dnsmasq test there but I can find or make one. It seems adding |
More config generation fixes: |
Failing test for dnsmasq+resolved: #259644 |
Ohh, here's a fun one! I switched a machine to networkd and its DHCP-assigned IPv4 address changed even though this machine's MAC address has a static address reservation configured on the DHCP server (Kea). This happened because the DHCP Client ID changed when switching to networkd. I don't think we can do anything to fix this, but we should mention it in the upgrade instructions when networkd becomes the default. [EDIT to avoid notification spam] I think my container issues are caused by enabling systemd-resolved on the host. These are declarative containers with the default |
re containers: if it's about DNS, you'll most likely need sth. like "issues with NixOS container connectivity" is rather vague, so that's just a wild guess. Even the existing container subsystem works surprisingly well with networkd I discovered over the last months. EDIT: OK, seems as if the issue was found already. The message appeared right after I submitted, thanks GitHub 🙃 |
Ah I thought I had sent this comment last week, but apparently I didn't. Anyways, here we go:
Haven't looked through all, but e.g. |
Superseded by #264967 |
Description of changes
Enables networkd by default and adjusts docs and tests accordingly.
Things done
networking.*
options that are ignored when using networkduseDHCP
andanyInterface
some more -- do the defaults make sense?