From ffbb72f51e53e148946a5a283fad9cfb667cb37a Mon Sep 17 00:00:00 2001 From: BrainStone Date: Sun, 19 Feb 2023 03:48:35 +0100 Subject: [PATCH] Change default rules so they work for all setups --- src/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config.js b/src/config.js index 28c9fc5a..2523f896 100644 --- a/src/config.js +++ b/src/config.js @@ -18,7 +18,8 @@ module.exports.WG_ALLOWED_IPS = process.env.WG_ALLOWED_IPS || '0.0.0.0/0, ::/0'; module.exports.WG_PRE_UP = process.env.WG_PRE_UP || ''; module.exports.WG_POST_UP = process.env.WG_POST_UP || ` -iptables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o eth0 -j MASQUERADE; +iptables -t mangle -A PREROUTING -i wg0 -j MARK --set-mark 0x30; +iptables -t nat -A POSTROUTING ! -o wg0 -m mark --mark 0x30 -j MASQUERADE; iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT; iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT;