From e7c87670bc6d6aa6f41b5f071adc45f5b044e8a0 Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 28 Apr 2023 23:17:53 +0200 Subject: [PATCH] migrated dhcp to kea --- nixos/hosts/olympus/dhcp/configuration.nix | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/nixos/hosts/olympus/dhcp/configuration.nix b/nixos/hosts/olympus/dhcp/configuration.nix index 3ea6ed1..f6b1163 100644 --- a/nixos/hosts/olympus/dhcp/configuration.nix +++ b/nixos/hosts/olympus/dhcp/configuration.nix @@ -1,11 +1,6 @@ { config, pkgs, flat_hosts, ... }: let inherit (builtins) filter hasAttr; - hostToDhcp = { hostname, mac, ip, ... }: { - ethernetAddress = mac; - hostName = hostname; - ipAddress = ip; - }; hostToKea = {hostname, mac, ip, ...}: { inherit hostname; hw-address = mac; @@ -41,25 +36,9 @@ in { networking.firewall.allowedUDPPorts = [ 67 ]; - services.dhcpd4 = { - enable = true; - extraConfig = '' - option subnet-mask 255.255.254.0; - option broadcast-address 10.42.43.255; - option routers 10.42.42.1; - option domain-name-servers 10.42.42.15, 10.42.42.16; - option domain-name "${localDomain}"; - option domain-search "${localDomain}"; - subnet 10.42.42.0 netmask 255.255.254.0 { - range 10.42.43.1 10.42.43.254; - } - ''; - machines = map hostToDhcp hosts; - }; - services.kea = { dhcp4 = { - enable = false; + enable = true; settings = { authoritative = true; valid-lifetime = 4000;