From 94143d389cd3a34857ed0bf5327fa522ed1a03c9 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Mon, 3 May 2021 18:02:31 -0400 Subject: Update router --- config/router.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'config/router.nix') diff --git a/config/router.nix b/config/router.nix index aaa2a42..1bcf876 100644 --- a/config/router.nix +++ b/config/router.nix @@ -211,15 +211,19 @@ in 200 he ''; - networking.localCommands = '' - ip -6 rule add from 2001:470:8e2e::/48 lookup he prio 0 || true - ip -6 route flush cache - ip -6 route replace default dev he0 src 2001:470:8e2e:20::d table he - ip -6 route flush cache - ''; + systemd.services.network-route-setup = { + description = "HE tunnel route setup"; + requires = ["network-online.target"]; + after = ["network.target" "network-online.target"]; + wantedBy = ["multi-user.target"]; + script = '' + ip -6 rule add from 2001:470:8e2e::/48 lookup he prio 0 || true + ip -6 route replace default dev he0 src 2001:470:8e2e:20::d table he + ip -6 route flush cache + ''; + }; networking.wireguard.interfaces.mullvad.postSetup = '' - ip route flush cache ip rule add fwmark ${toString mullvadMark} table mullvad ip route replace default dev mullvad table mullvad ip route flush cache -- cgit v1.2.3