fix sigma router dhcp dns

Instead of explicitly overwriting the DNS in the DHCPServer config we
ignore the upstream DNS from DHCP on the upstream interface so
networkctl/resolvectl understands the right DNS server, and can forward
it to DHCP clients.
This commit is contained in:
Casper V. Kristensen 2024-06-13 01:02:38 +02:00
parent 5f2d0ddf00
commit 5f0e99e48d

View file

@ -23,6 +23,9 @@
# does not use IPv6. # does not use IPv6.
DHCP = "ipv4"; DHCP = "ipv4";
}; };
# Ignore ISP DNS server(s) received from the DHCP server
dhcpV4Config.UseDNS = false;
dhcpV6Config.UseDNS = false;
}; };
networks."20-lan" = { networks."20-lan" = {
# Intel pci port (right) # Intel pci port (right)
@ -33,8 +36,8 @@
networkConfig = { networkConfig = {
# Enable DHCP *server*. By default, the DHCP leases handed out to # Enable DHCP *server*. By default, the DHCP leases handed out to
# clients contain DNS information from our own uplink interface and # clients contain DNS information from our own uplink interface and
# specify our own address as the router. # specify our own address as the router. See DHCP leases with
# See offered DHCP leases with `networkctl status enp4s0f0`. # `networkctl status enp4s0f0` and `dhcpdump -i enp4s0f0`.
DHCPServer = true; DHCPServer = true;
# Enable IP masquerading (NAT) to rewrite the address on packets # Enable IP masquerading (NAT) to rewrite the address on packets
# forwarded from this interface so as to appear as coming from this # forwarded from this interface so as to appear as coming from this
@ -42,16 +45,6 @@
# "router" since each lan host does not get its own public IP address. # "router" since each lan host does not get its own public IP address.
IPMasquerade = "ipv4"; IPMasquerade = "ipv4";
}; };
dhcpServerConfig = {
# TODO
# networks."00-ignore-dhcp-dns" = {
# matchConfig.Name = "*";
# dhcpV4Config.UseDNS = false;
# dhcpV6Config.UseDNS = false;
# };
# Explicitly override the propagated DNS servers
DNS = config.networking.nameservers;
};
}; };
# The following establishes a wireguard tunnel to alpha and configures # The following establishes a wireguard tunnel to alpha and configures