This patch is to add in support for IP NAT Masquerade functionality.

This commit is contained in:
Jason Parks
2023-05-17 10:55:11 -06:00
parent 79acdb39bb
commit 1a63139ed9
4 changed files with 9 additions and 0 deletions

View File

@@ -32,6 +32,12 @@ if [ "${CREATE_TUN_DEVICE}" = "true" ]; then
chmod 0666 /dev/net/tun
fi
# Enable NAT w MASQUERADE mode
if [ "${ENABLE_MASQUERADE}" = "true" ]; then
echo "Enabling IP MASQUERADE using IP Tables"
iptables -t nat -A POSTROUTING -o tun+ -j MASQUERADE
fi
openvpn --config $VPN_FILE --auth-user-pass vpn-auth.txt --mute-replay-warnings $OPENVPN_OPTS --script-security 2 --up /vpn/sockd.sh
if [ "${ENABLE_KILL_SWITCH}" = "true" ]; then