-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
systemd-networkd: Generated network configuration breaks resolved DBus API #18962
Comments
Resolved might not work because nss module for resolved is ignored currently by libc. |
Should we add an option The simplest network use case is probably "get ip, domain, gateway from dhcp on all interfaces (that may appear)" and should be covered without any configuration. |
@Mic92 That's a separate issue, I believe. Even without the nss module, resolved should handle requests to its DBus API and work independently; i.e. resolution can be performed with In my case, I've forced a symlink from |
This issue of 99-main.network matching everything leads to cjdns being broken when networkd is enabled. I see additional options to fix this which have not been mentioned yet:
I'll work on a PR for the |
You could also manage a black- and/or whitelist like |
@fpletz Thanks for the hint to just look at how it's done in We could add something like
The problem is, this What would work is to interpret PR for |
I am in favor of introducing the A more controversial option: default |
Came up with an another workaround for you @tadfisher . networkd loads
|
Provides a solution for NixOS#18962.
Provides a solution for NixOS#18962.
Somehow, this now also causes the loopback interface to lose its configuration when resuming the machine from suspend. Disabling |
This is the exact problem, I was having. Worked around it, by configuring it with 127.0.0.1 Also, |
I think wildcards are supported, though not documented. This allows you to opt into DHCP for each interface type, including your USB modem.
|
With networkd directly, more deliberate matchConfigs can be created. E.g. match based on device driver.
|
already tried that, it fails at boot, thus adding 1:30m I have working wildcards at Awesome idea with matching on the USB driver, though. I'll try that. |
Just maching all network interfaces caused many breakages, see NixOS#18962 and NixOS#71106. We already don't support the global networking.useDHCP, networking.defaultGateway(6) options if networking.useNetworkd is enabled, but direct users to configure the per-device networking.interfaces.<name?>.… options.
@tadfisher, @bendlas: We merged #71790, so we shouldn't need any workaround here anymore, and this issue could be closed. Can you have a look? |
@flokli I'll check it out when it hits |
Nice, cool to hear! Will take a look at the PR tomorrow with @fpletz :-)
|
This was fixed by #71790. |
Issue description
network-interfaces-systemd.nix
generates/etc/systemd/network/99-main.network
which matches all network interfaces, in order to enforce thenetworking.useDHCP
option. This has the effect of forcing all network interfaces to be "managed" by systemd-networkd.Upstream does not allow managed interfaces to be configured via the
org.freedesktop.resolve1
DBus API, as the following transcript demonstrates:Note that the primary motivation for using the
resolved
DBus API is to manage per-interface DNS, which I do not believe is possible viaopenresolv
. Invoking this API is a clean way to prevent DNS leaks overtun0
when connecting to an OpenVPN server, for example. In this example,tun0
is not configured vianetworking.interfaces."tun0"
and an explicitly-matching.network
configuration does not exist.I've been able to work around this problem with the following in
configuration.nix
:A solution that seems reasonable to me would be to treat
networking.useDHCP = null;
differently fromtrue
orfalse
, and refrain from generating a default.network
configuration which matches all interfaces. However, this changes the semantics of that option whennetworking.useNetworkd
is enabled.Steps to reproduce
This can be demonstrated with the following configuration:
Then using
busctl
as shown above to attempt setting per-interface DNS or DOMAIN options on any interface which is not configured vianetworking.interfaces.<name>
.Technical details
The text was updated successfully, but these errors were encountered: