underlay: Refuse DNS servers from DHCP

This commit is contained in:
SebastianStork 2026-03-04 15:58:54 +01:00
parent 70140d0af4
commit d9a85536a2
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q

View file

@ -51,6 +51,7 @@ in
matchConfig.Name = cfg.interface;
linkConfig.RequiredForOnline = "routable";
networkConfig.DHCP = lib.mkIf cfg.useDhcp "yes";
dhcpV4Config.UseDNS = lib.mkIf cfg.useDhcp false;
address = lib.optional (cfg.cidr != null) cfg.cidr;
routes = lib.optional (cfg.gateway != null) {
Gateway = cfg.gateway;