diff --git a/openvpn-install.sh b/openvpn-install.sh index 1afee19..e26a89e 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -181,8 +181,8 @@ else # Avoid an unneeded reboot echo 1 > /proc/sys/net/ipv4/ip_forward # Set iptables - iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to $IP - sed -i "/# By default this script does nothing./a\iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to $IP" /etc/rc.local + iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP + sed -i "/# By default this script does nothing./a\iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP" /etc/rc.local # And finally, restart OpenVPN /etc/init.d/openvpn restart # Let's generate the client config