From 985d7ea69699a47d120a390cb720fb01aee948ce Mon Sep 17 00:00:00 2001 From: magic_rb Date: Sat, 7 Oct 2023 22:44:42 +0200 Subject: [PATCH] Switch the dhcp server on blowhole to kea Signed-off-by: magic_rb --- nixos/systems/blowhole/firewall.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/nixos/systems/blowhole/firewall.nix b/nixos/systems/blowhole/firewall.nix index 4f2b1ea..d4c72e1 100644 --- a/nixos/systems/blowhole/firewall.nix +++ b/nixos/systems/blowhole/firewall.nix @@ -60,15 +60,20 @@ in before = [ "network-online.target" ]; }; - services.dhcpd4 = { + services.kea.dhcp4 = { enable = true; - interfaces = [ "${lan}" ]; # "${wlan}" - extraConfig = '' - option domain-name-servers ${secret.network.ips.blowhole.ip or ""}; - option subnet-mask 255.255.255.0; - - ${secret.dhcp.blowhole.zones or (const "") { inherit wlan lan; }} - ''; + settings = { + interfaces-config.interfaces = [ + "${lan}" + ]; + lease-database = { + name = "/var/lib/kea/dhcp4.leases"; + persist = true; + type = "memfile"; + }; + rebind-timer = 2000; + renew-timer = 1000; + } // (secret.dhcp.blowhole.zones or (const {}) { inherit wlan lan; }); }; networking = {