Skip to content
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.network.dhcpNetworks: init nixos option #72044

Closed
wants to merge 1 commit into from

Conversation

bendlas
Copy link
Contributor

@bendlas bendlas commented Oct 26, 2019

this allows to configures common physical interfaces (en*, wl*) with dhcp

Motivation for this change

After switching to networkd, we should still provide a plug-and-play experience for common physical device and make it easy to configure a non-standard interface with dhcp.

Things done

This allows to set systemd.network.dhcpNetworks as a list of systemd.network.networks.matchConfig.Names for being configured by DHCP.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
  • Tested compilation
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
TODO

This PR is a suggestion, based on my current solution, using networkd on a Desktop and Laptop.

Maybe this should be derived from network.useDHCP instead, but I think it's good to have a central switch for that behavior.

Notify maintainers

cc @fpletz @arianvp @flokli

this configures common physical interfaces (en*, wl*) with dhcp
@jD91mZM2
Copy link
Member

Code looks good to me

@fpletz
Copy link
Member

fpletz commented Oct 28, 2019

Thanks a lot for the suggestion. I'm not sure though if such an option is a good idea. Please wait before merging this until the community has reached a decision on redesigning the networking module after the networkd sprint in a few weeks. (Will announce it in Discourse later)

@arianvp
Copy link
Member

arianvp commented Oct 28, 2019

Also it is already sort of implemented by the fact that nixos-generate-config enables DHCP for each interface detected during install. This feature is in conflict with that.

@bendlas
Copy link
Contributor Author

bendlas commented Oct 28, 2019

I'm not sure though if such an option is a good idea.

me neither, especially the interface ..

It mainly solves my need short-term need and I wanted to register a requirement for pluggable network hardware (mainly desktops, laptops)

Also it is already sort of implemented by the fact that nixos-generate-config enables DHCP for each interface detected during install.

It doesn't work for usb modems and other runtime-pluggable hardware, especially since their interface names can change on re-plug.

I agree that it might be better to predicate on driver name, as you suggested on the previous PR.

@flokli
Copy link
Contributor

flokli commented Oct 29, 2019

useNetworkd is still marked as experimental, and defaulting to dhcp on a lot of interfaces leads to multiple problems, as explained in #71790 and linked issues.

Users that want above functionality regardless, can still accomplish the same functionality by manually setting something like that:

systemd.network.networks."10-dhcp-convenience" = {
  matchConfig.Name = "en* wl*";
  DHCP = "yes";
};

I'm also not in favour of introducing such an option. Providing some out of the box experience for installation media is definitely something we don't want to break, but I don't think this PR is the right way to go forward, especially given we want to redesign the provided options in the networkd sprint.

@flokli flokli closed this Oct 29, 2019
@bendlas
Copy link
Contributor Author

bendlas commented Nov 6, 2019

useNetworkd is still marked as experimental, and defaulting to dhcp on a lot of interfaces leads to multiple problems, as explained in #71790 and linked issues.

Yep, in fact, I think I can now get rid of a couple of linkConfig.Unmanaged for docker and virbr, now.
Thanks, for your work on this! @flokli

@bendlas bendlas deleted the networkd-dhcp branch October 22, 2023 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants