1
0
mirror of synced 2025-03-03 19:33:16 +03:00

Improve VPN setup

- When uninstalling, leave IP forwarding enabled if OpenVPN
  or WireGuard is installed on the system.
This commit is contained in:
hwdsl2 2022-05-20 20:05:10 -05:00
parent b6db45c204
commit 0e08b79342

View File

@ -186,7 +186,9 @@ update_sysctl() {
else
sed --follow-symlinks -i '/# Added by hwdsl2 VPN script/,+17d' /etc/sysctl.conf
fi
echo 0 > /proc/sys/net/ipv4/ip_forward
if [ ! -f /usr/bin/wg-quick ] && [ ! -f /usr/sbin/openvpn ]; then
echo 0 > /proc/sys/net/ipv4/ip_forward
fi
echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter
fi
}