From 7a9d0481ee7d19394e446bdb5b9d48d4f5f7e31d Mon Sep 17 00:00:00 2001 From: LavaDesu Date: Sun, 13 Feb 2022 15:40:11 +0700 Subject: [PATCH] system/wireguard: fix setup/shutdown commands --- modules/system/wireguard.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/system/wireguard.nix b/modules/system/wireguard.nix index b28a4dd..2218d31 100644 --- a/modules/system/wireguard.nix +++ b/modules/system/wireguard.nix @@ -82,11 +82,13 @@ let ips = client.allowedIPs; listenPort = port; - postSetup = mappedAdd + '' + postSetup = '' + ${mappedAdd} ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o ${serverInterface} -j MASQUERADE ''; - postShutdown = mappedDel + '' + postShutdown = '' + ${mappedDel} ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.100.0.0/24 -o ${serverInterface} -j MASQUERADE '';