mirror of
https://github.com/hwdsl2/setup-ipsec-vpn.git
synced 2026-05-17 08:05:45 +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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user