Open edolstra opened 9 years ago
What's the timeline for it? I'm a little bit worried that by dropping the scripted implementation it gets quite hard to realize network setups that systemd-networkd
was not specifically designed for. Network setups that can be realized within the scripted implementation, like, e.g., #10000, would have to be implemented, and upstreamed, in systemd-networkd
. Well, I can clearly see the advantages of when things work within systemd-networkd
, but I wouldn't rush to drop the currently scripted implementation.
Note to self: we can remove the legacy nixos/modules/services/hardware/80-net-setup-link.rules
when using systemd-networkd.
A good article explaining the benefits and path to migration https://tlhp.cf/systemd-networkd-migration-and-benchmarks/
Bumping milestone.
Is there still a chance this will happen for 16.09?
Not really.
One argument in favor of rethinking the networking.*
abstraction: https://github.com/NixOS/nixpkgs/issues/18962
I'm really in favor of this switch, and am using networkd with nixos where it's possible already.
One big problem is: networkd is not suitable for (changing) wifi configuration. So for mobile devices we will still have to provide a non-networkd path. Imo it would be enough to recommend network-manager for this use case so we can drop most of the scripted stuff..
What do others think about this?
Well, not being able to support wifi configurations makes it unsuitable as the default option at least...
Wifi config seems orthogonal to using networkd for base network configuration. Any interfaces not managed by networkd will continue to work in an unmanaged mode, which other daemons like NetworkManager can happily manage for you if you need easy wifi configuration.
@edolstra networkd supports wifi now
This is a blocker: https://github.com/NixOS/nixpkgs/issues/62034
For someone that wants to use networkd now, what is the best guide/resource to follow?
I've tried
networking = {
useDHCP = false;
useNetworkd = true;
};
and it doesn't work.
cc @haslersn maybe easily doable for you as you migrated our ansible infrastructure?
Hello, I'm a bot and I thank you in the name of the community for opening this issue.
To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.
The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.
If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.
Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.
This is probably still a goal.
Would it be possible for stalebot to skip milestoned issues?
A label would have to be added here https://github.com/NixOS/nixpkgs/blob/master/.github/stale.yml#L7.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/state-of-systemd-networkd-networking-backend-in-nixos/10598/1
I marked this as stale due to inactivity. → More info
Not yet.
For what it's worth, I've been using systemd-networkd exclusively with nixos-20.09 and nixos-21.05, to great success.
networking.dhcpcd.enable = false;
networking.useNetworkd = true;
networking.useDHCP = false;
# this keeps failing, both the binary and the finality of such state
# is a fallacy anyway
systemd.services."systemd-networkd-wait-online".enable = false;
@tv42 Thanks! Is that really all you need to configure? It seems I still have to add lines like
networking.interfaces.wlp0s20f3.useDHCP = true;
to make it work. Is there a way to tell systemd-networkd
to manage all devices, even those that might be dynamically plugged in?
I'm using a similar config to @tv42 and had to add:
networking.wireless.interfaces = [ "wlp3s0" ];
to make it work. Is there a way to tell
systemd-networkd
to manage all devices, even those that might be dynamically plugged in?
This is what i use for example:
{ config, lib, ... }:
{
networking = {
useDHCP = false;
useNetworkd = true;
};
systemd.network.networks = let
networkConfig = {
DHCP = "yes";
DNSSEC = "yes";
DNSOverTLS = "yes";
DNS = [ "1.1.1.1" "1.0.0.1" ];
};
in {
# Config for all useful interfaces
"40-wired" = {
enable = true;
name = "en*";
inherit networkConfig;
dhcpV4Config.RouteMetric = 1024; # Better be explicit
};
"40-wireless" = {
enable = true;
name = "wl*";
inherit networkConfig;
dhcpV4Config.RouteMetric = 2048; # Prefer wired
};
};
# Wait for any interface to become available, not for all
systemd.services."systemd-networkd-wait-online".serviceConfig.ExecStart = [
"" "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online --any"
];
}
EDIT: the way systemd does *.network
merging is weird
In my opinion networking.*
is awful, it tries to abstract over networkd while having about 0 options, you can't even change DNS while using DHCP, can't set DNSSEC, DOT config.
Why try to invent a bicycle, why try to make some wrappers around networkd?
Maybe instead we should just switch to networkd by itself, aka systemd.network.*
?
It would be much easier to maintain this.
What do you think?
The networking.*
options predate networkd. And the fact that these options exist is what allows us to switch to different networking implementations without invalidating every configuration.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/status-of-networkd-as-default/3517/1
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/plans-for-the-networkd-infrastructure/23086/4
https://github.com/NixOS/nixpkgs/pull/202488 is trying to implement this
# Wait for any interface to become available, not for all systemd.services."systemd-networkd-wait-online".serviceConfig.ExecStart = [ "" "${config.systemd.package}/lib/systemd/systemd-networkd-wait-online --any" ];
This can be achieved by systemd.network.wait-online.anyInterface = true;
option too.
202488 is trying to implement this
Latest PR trying to archive this: https://github.com/NixOS/nixpkgs/pull/264967
This can be achieved by systemd.network.wait-online.anyInterface = true; option too.
This is now the default behaviour for networking.useNetworkd = true
with networking.useDHCP = true
Currently we have two implementations of the basic network options (like
networking.interfaces
), namely the old scripted implementation, and systemd-networkd. We should make the latter the default and (eventually) drop the former.This would also remove dhcpcd and possibly replace openresolv by systemd-resolved.