diff options
-rw-r--r-- | hosts/vidhar/default.nix | 54 | ||||
-rw-r--r-- | hosts/vidhar/dsl.nix | 11 |
2 files changed, 41 insertions, 24 deletions
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 @@ | |||
158 | "eno2".networkConfig.LinkLocalAddressing = "no"; | 158 | "eno2".networkConfig.LinkLocalAddressing = "no"; |
159 | "telekom".networkConfig.LinkLocalAddressing = "no"; | 159 | "telekom".networkConfig.LinkLocalAddressing = "no"; |
160 | }; | 160 | }; |
161 | services.dhcpd6 = { | 161 | systemd.services."dhcpcd-telekom" = { |
162 | enable = true; | 162 | wantedBy = [ "multi-user.target" "network-online.target" ]; |
163 | configFile = pkgs.writeText "dhcpd6.conf" '' | 163 | bindsTo = [ "pppd-telekom.service" ]; |
164 | interface dsl { | 164 | after = [ "pppd-telekom.service" ]; |
165 | send ia-pd 0; | 165 | wants = [ "network.target" ]; |
166 | }; | 166 | before = [ "network-online.target" ]; |
167 | 167 | ||
168 | id-assoc pd 0 { | 168 | path = with pkgs; [ dhcpcd nettools openresolv ]; |
169 | prefix-interface eno1 { | 169 | unitConfig.ConditionCapability = "CAP_NET_ADMIN"; |
170 | sla-id 0; | 170 | |
171 | }; | 171 | stopIfChanged = false; |
172 | }; | 172 | |
173 | ''; | 173 | serviceConfig = let |
174 | dhcpcdConf = pkgs.writeText "dhcpcd.conf" '' | ||
175 | duid | ||
176 | persistent | ||
177 | vendorclassid | ||
178 | |||
179 | nooption domain_name_servers, domain_name, domain_search | ||
180 | option classless_static_routes | ||
181 | option interface_mtu | ||
182 | |||
183 | option host_name | ||
184 | option rapid_commit | ||
185 | require dhcp_server_identifier | ||
186 | slaac private | ||
187 | |||
188 | noipv6rs # disable routing solicitation | ||
189 | allowinterfaces dsl | ||
190 | interface dsl | ||
191 | ipv6rs # enable routing solicitation for WAN adapter | ||
192 | ia_na 1 # request an IPv6 address | ||
193 | ia_pd 1 eno1/0 # request a PD and assign it to the LAN | ||
194 | ''; | ||
195 | in { | ||
196 | Type = "forking"; | ||
197 | PIDFile = "/run/dhcpcd.pid"; | ||
198 | ExecStart = "@${pkgs.dhcpcd}/sbin/dhcpcd dhcpcd --config ${dhcpcdConf}"; | ||
199 | ExecReload = "${pkgs.dhcpcd}/sbin/dhcpcd --rebind"; | ||
200 | Restart = "always"; | ||
201 | }; | ||
174 | }; | 202 | }; |
175 | 203 | ||
176 | services.timesyncd.enable = false; | 204 | services.timesyncd.enable = false; |
diff --git a/hosts/vidhar/dsl.nix b/hosts/vidhar/dsl.nix index 2316c888..1651284c 100644 --- a/hosts/vidhar/dsl.nix +++ b/hosts/vidhar/dsl.nix | |||
@@ -59,17 +59,6 @@ in { | |||
59 | ''; | 59 | ''; |
60 | mode = "0555"; | 60 | mode = "0555"; |
61 | }; | 61 | }; |
62 | "ppp/ipv6-up" = { | ||
63 | text = '' | ||
64 | #!${pkgs.runtimeShell} | ||
65 | ${pkgs.procps}/bin/sysctl net/ipv6/conf/$1/use_tempaddr=1 | ||
66 | ${pkgs.procps}/bin/sysctl net/ipv6/conf/$1/forwarding=1 | ||
67 | ${pkgs.procps}/bin/sysctl net/ipv6/conf/$1/autoconf=1 | ||
68 | ${pkgs.procps}/bin/sysctl net/ipv6/conf/$1/accept_ra=1 | ||
69 | ${pkgs.ndisc6}/bin/rdisc6 $1 | ||
70 | ''; | ||
71 | mode = "0555"; | ||
72 | }; | ||
73 | }; | 62 | }; |
74 | 63 | ||
75 | systemd.network.networks."dsl" = { | 64 | systemd.network.networks."dsl" = { |