From 2c08e3423ab4752fd891057a0100fd451725dc45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 10 Mar 2023 09:50:16 +0100 Subject: nixos/router: try to add IPv6 support --- nixos/routers/router.nix | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/nixos/routers/router.nix b/nixos/routers/router.nix index 561f9de..25d12da 100644 --- a/nixos/routers/router.nix +++ b/nixos/routers/router.nix @@ -71,7 +71,21 @@ in { externalInterface = cnf.wan; internalInterfaces = ["brlan" "brguest"]; }; - dhcpcd.allowInterfaces = [cnf.wan]; + dhcpcd = { + allowInterfaces = [cnf.wan]; + extraConfig = '' + duid + noipv6rs + waitip 6 + + interface ${cnf.wan} + ipv6rs + iaid 1 + + ia_pd 1 brlan + #ia_pd 1/::/64 LAN/0/64 + ''; + }; nameservers = ["1.1.1.1" "8.8.8.8"]; }; @@ -132,13 +146,30 @@ in { ]; }; }; - # TODO dhcp6 }; systemd.services.kea-dhcp4-server.after = [ "sys-subsystem-net-devices-brlan.device" "sys-subsystem-net-devices-brguest.device" ]; + services.radvd = { + enable = true; + config = '' + interface ${cnf.wan} { + AdvSendAdvert on; + MinRtrAdvInterval 3; + MaxRtrAdvInterval 10; + prefix ::/64 { + AdvOnLink on; + AdvAutonomous on; + AdvRouterAddr on; + }; + RDNSS 2001:4860:4860::8888 2001:4860:4860::8844 { + }; + }; + ''; + }; + services.kresd = {enable = false;}; networking.nftables.enable = true; -- cgit v1.2.3