From 51c03e46e5241f077a86ba8af4383fc4ee35cc72 Mon Sep 17 00:00:00 2001 From: Yuri Tatishchev Date: Tue, 18 Mar 2025 00:11:49 -0700 Subject: [PATCH] WIP: router: move wan ipv4 configuration from dhcpcd to networkd --- hosts/router/ifconfig.nix | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/hosts/router/ifconfig.nix b/hosts/router/ifconfig.nix index 590efcd..d9752c5 100644 --- a/hosts/router/ifconfig.nix +++ b/hosts/router/ifconfig.nix @@ -58,11 +58,12 @@ in nohook resolv.conf, yp, hostname, ntp interface ${ifs.wan.name} + ipv6only # IPv4 (Static) - nodhcp - noipv4ll - static ip_address=${ifs.wan.addr4Sized} - static routers=${ifs.wan.gw4} + # nodhcp + # noipv4ll + # static ip_address=${ifs.wan.addr4Sized} + # static routers=${ifs.wan.gw4} # IPv6 duid @@ -127,10 +128,24 @@ in networks = { "10-wan" = { matchConfig.Name = ifs.wan.name; - linkConfig = { - Unmanaged = true; - RequiredForOnline = "routable"; + +# linkConfig = { +# Unmanaged = true; +# RequiredForOnline = "routable"; +# }; + # make routing on this interface a dependency for network-online.target + linkConfig.RequiredForOnline = "routable"; + networkConfig = { + # start a DHCP Client for IPv4 Addressing/Routing + # DHCP = "ipv4"; + # accept Router Advertisements for Stateless IPv6 Autoconfiguraton (SLAAC) + # let dhcpcd handle this + Address = [ ifs.wan.addr4Sized ]; + IPv6AcceptRA = false; }; + routes = [ + { Gateway = ifs.wan.gw4; } + ]; }; "20-lan" = (mkLanConfig ifs.lan) // { vlan = [