From 09bb23b37de319648c170089528d34fec07baab9 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Mon, 29 Aug 2022 18:31:52 +0300 Subject: [PATCH] update configs in cfg_gen --- config_generator/wg-internal.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config_generator/wg-internal.conf b/config_generator/wg-internal.conf index 1fabeef..e084607 100644 --- a/config_generator/wg-internal.conf +++ b/config_generator/wg-internal.conf @@ -3,9 +3,9 @@ Address = 10.20.30.1/32 ListenPort = 17968 PrivateKey = ---PRIVATE_KEY_INTERNAL--- PostUp = iptables -t nat -A POSTROUTING -o `ip route | awk '/default/ {print $5; exit}'` -j MASQUERADE -PostUp = ip rule add from `ip route | awk '/default/ {print $3; exit}'` table main +PostUp = ip rule add from `ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | grep -v "inet6" | head -n 1 | awk '/inet/ {print $2}' | awk -F/ '{print $1}'` table main PostDown = iptables -t nat -D POSTROUTING -o `ip route | awk '/default/ {print $5; exit}'` -j MASQUERADE -PostDown = ip rule del from `ip route | awk '/default/ {print $3; exit}'` table main +PostDown = ip rule del from `ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | grep -v "inet6" | head -n 1 | awk '/inet/ {print $2}' | awk -F/ '{print $1}'` table main #external node [Peer]