Skip to content

Commit

Permalink
Merge pull request NixOS#256598 from adamcstephens/net/warn-multiple-net
Browse files Browse the repository at this point in the history
nixos/networking: warn when both networkd and dhcpcd can collide
  • Loading branch information
Ma27 authored Oct 14, 2023
2 parents 080759b + b4e162a commit d664571
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nixos/modules/tasks/network-interfaces.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,10 @@ in

config = {

warnings = concatMap (i: i.warnings) interfaces;
warnings = (concatMap (i: i.warnings) interfaces) ++ (lib.optional
(config.systemd.network.enable && cfg.useDHCP && !cfg.useNetworkd) ''
The combination of `systemd.network.enable = true`, `networking.useDHCP = true` and `networking.useNetworkd = false` can cause both networkd and dhcpcd to manage the same interfaces. This can lead to loss of networking. It is recommended you choose only one of networkd (by also enabling `networking.useNetworkd`) or scripting (by disabling `systemd.network.enable`)
'');

assertions =
(forEach interfaces (i: {
Expand Down

0 comments on commit d664571

Please sign in to comment.