diff --git a/hosts/genesis/networking.nix b/hosts/genesis/networking.nix index e35a8db..d0a1de1 100644 --- a/hosts/genesis/networking.nix +++ b/hosts/genesis/networking.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ config, pkgs, ... }: let lan = "ens18"; lanIP = "10.42.1.5"; @@ -76,16 +76,18 @@ in environment.etc."hosts.d/local".text = extraHosts; services = { - kea.dhcp4 = ( - import ./networking/dhcp.nix { - inherit - iot - lan - lanIP - routerIP - ; - } - ); + kea = { + dhcp4 = ( + import ./networking/dhcp.nix { + inherit + iot + lan + lanIP + routerIP + ; + } + ); + }; ######### # dnsmasq config @@ -113,7 +115,8 @@ in dnsmasq.enable = true; kea = { enable = true; - targets = [ "http://127.0.0.1:8547" ]; + openFirewall = true; + targets = [ (builtins.head config.services.kea.dhcp4.settings.control-sockets).socket-name ]; }; }; }; # End of services configuration diff --git a/hosts/genesis/networking/dhcp.nix b/hosts/genesis/networking/dhcp.nix index a50f608..0e5ace2 100644 --- a/hosts/genesis/networking/dhcp.nix +++ b/hosts/genesis/networking/dhcp.nix @@ -7,6 +7,12 @@ { enable = true; settings = { + control-sockets = [ + { + socket-type = "unix"; + socket-name = "/run/kea/dhcp4-control.sock"; + } + ]; valid-lifetime = 43200; # 12 hours, in seconds renew-timer = 1000; rebind-timer = 2000;