From 2be8ddd04ef400c1e9106626e7fcbc505e52ebc1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 15 Nov 2021 11:25:58 +0059 Subject: vidhar: ... --- hosts/vidhar/default.nix | 54 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 13 deletions(-) (limited to 'hosts/vidhar/default.nix') diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix index 7657c4a8..d9d44070 100644 --- a/hosts/vidhar/default.nix +++ b/hosts/vidhar/default.nix @@ -158,19 +158,47 @@ "eno2".networkConfig.LinkLocalAddressing = "no"; "telekom".networkConfig.LinkLocalAddressing = "no"; }; - services.dhcpd6 = { - enable = true; - configFile = pkgs.writeText "dhcpd6.conf" '' - interface dsl { - send ia-pd 0; - }; - - id-assoc pd 0 { - prefix-interface eno1 { - sla-id 0; - }; - }; - ''; + systemd.services."dhcpcd-telekom" = { + wantedBy = [ "multi-user.target" "network-online.target" ]; + bindsTo = [ "pppd-telekom.service" ]; + after = [ "pppd-telekom.service" ]; + wants = [ "network.target" ]; + before = [ "network-online.target" ]; + + path = with pkgs; [ dhcpcd nettools openresolv ]; + unitConfig.ConditionCapability = "CAP_NET_ADMIN"; + + stopIfChanged = false; + + serviceConfig = let + dhcpcdConf = pkgs.writeText "dhcpcd.conf" '' + duid + persistent + vendorclassid + + nooption domain_name_servers, domain_name, domain_search + option classless_static_routes + option interface_mtu + + option host_name + option rapid_commit + require dhcp_server_identifier + slaac private + + noipv6rs # disable routing solicitation + allowinterfaces dsl + interface dsl + ipv6rs # enable routing solicitation for WAN adapter + ia_na 1 # request an IPv6 address + ia_pd 1 eno1/0 # request a PD and assign it to the LAN + ''; + in { + Type = "forking"; + PIDFile = "/run/dhcpcd.pid"; + ExecStart = "@${pkgs.dhcpcd}/sbin/dhcpcd dhcpcd --config ${dhcpcdConf}"; + ExecReload = "${pkgs.dhcpcd}/sbin/dhcpcd --rebind"; + Restart = "always"; + }; }; services.timesyncd.enable = false; -- cgit v1.2.3