From 79df1661b52c315a58d8420d628ecf8f912dca9e Mon Sep 17 00:00:00 2001 From: xwvike Date: Sat, 13 Jan 2024 12:47:34 +0800 Subject: [PATCH] Update the readme --- README.md | 1 + src/config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c1a5a99..30cd8b29 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ The Web UI will now be available on `http://0.0.0.0:51821`. > 💡 Your configuration files will be saved in `~/.wg-easy` +> 💡 If you discover that newly added allowed IPs on the client cannot communicate, you can try setting `net.ipv4.conf.all.src_valid_mark=0` when executing the `docker run` command. ### 3. Sponsor Are you enjoying this project? [Buy Emile a beer!](https://github.com/sponsors/WeeJeWel) 🍻 diff --git a/src/config.js b/src/config.js index 701f2389..3281523f 100644 --- a/src/config.js +++ b/src/config.js @@ -20,7 +20,7 @@ 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 -o ${module.exports.WG_DEVICE} -j MASQUERADE; +iptables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o ${module.exports.WG_DEVICE} -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;