From 7398ccb14ff56bba02afdee80e571aa226de17ea Mon Sep 17 00:00:00 2001 From: tm-sanjay Date: Thu, 5 Jan 2023 23:29:58 +0530 Subject: [PATCH] subnet 24 to 16 --- src/config.js | 2 +- src/lib/WireGuard.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.js b/src/config.js index d396b350..e62df350 100644 --- a/src/config.js +++ b/src/config.js @@ -18,7 +18,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 -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/24 -o eth0 -j MASQUERADE; +iptables -t nat -A POSTROUTING -s ${module.exports.WG_DEFAULT_ADDRESS.replace('x', '0')}/16 -o eth0 -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; diff --git a/src/lib/WireGuard.js b/src/lib/WireGuard.js index 7886ac91..2b87dd85 100644 --- a/src/lib/WireGuard.js +++ b/src/lib/WireGuard.js @@ -94,7 +94,7 @@ module.exports = class WireGuard { # Server [Interface] PrivateKey = ${config.server.privateKey} -Address = ${config.server.address}/24 +Address = ${config.server.address}/16 ListenPort = 51820 PreUp = ${WG_PRE_UP} PostUp = ${WG_POST_UP} @@ -199,7 +199,7 @@ AllowedIPs = ${client.address}/32`; return ` [Interface] PrivateKey = ${client.privateKey} -Address = ${client.address}/24 +Address = ${client.address}/16 ${WG_DEFAULT_DNS ? `DNS = ${WG_DEFAULT_DNS}` : ''} ${WG_MTU ? `MTU = ${WG_MTU}` : ''}