Skip to content

Commit

Permalink
Merge pull request #84221 from erictapen/dhcpcd-error-on-bridges
Browse files Browse the repository at this point in the history
[20.03] nixos/network-interfaces: Assert that bridges can get an address via DHCP
  • Loading branch information
worldofpeace committed Apr 10, 2020
2 parents f19157d + 54ad186 commit ab018f7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nixos/modules/tasks/network-interfaces.nix
Expand Up @@ -976,6 +976,17 @@ in
Temporary addresses are only needed when IPv6 is enabled.
'';
})) ++ [
{
assertion = cfg.useDHCP -> cfg.bridges == {};
message = ''
There are the bridges [ ${builtins.toString (builtins.attrNames cfg.bridges)} ] configured while `networking.useDHCP` is enabled.
dhcpcd doesn't give IPv4 addresses to bridges by default anymore,
so you have to set `networking.useDHCP = false` and then whitelist
every interface you need DHCP on with
`networking.interfaces.<name?>.useDHCP = true`.
'';
}
] ++ [
{
assertion = cfg.hostId == null || (stringLength cfg.hostId == 8 && isHexString cfg.hostId);
message = "Invalid value given to the networking.hostId option.";
Expand Down

0 comments on commit ab018f7

Please sign in to comment.