From 39bb1f8750bebedae434213ef63dc9a10dcb4f35 Mon Sep 17 00:00:00 2001 From: chayleaf Date: Sun, 14 Jul 2024 06:56:22 +0700 Subject: [PATCH] router: add ping-ipv6 hack --- system/hosts/router/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/system/hosts/router/default.nix b/system/hosts/router/default.nix index 2e6111d..7163dc9 100644 --- a/system/hosts/router/default.nix +++ b/system/hosts/router/default.nix @@ -792,6 +792,19 @@ in { interfaceNamespace = "init"; }); + # see https://pavluk.org/blog/2022/01/26/nixos_router.html + # (ipv6 doesn't work without this, for whatever reason) + systemd.services.ping-ipv6 = { + after = [ "network.target" "netns-wan.service" ]; + wants = [ "netns-wan.service" ]; + wantedBy = [ "default.target" ]; + serviceConfig = { + ExecStart = "${pkgs.iputils}/bin/ping -q ${netAddresses.netnsWan6}"; + Restart = "on-failure"; + RestartSec = "30s"; + }; + }; + systemd.services.vpn-tunnel = lib.mkIf (cfg.vpn.tunnel.mode == "ssh") { description = "VPN Tunnel"; wantedBy = [