mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-11-27 15:36:07 +03:00
Allow intra-VPN networking
By excluding the internal network from the SNAT route, intra-VPN traffic will be routed correctly.
This commit is contained in:
parent
6d89279940
commit
6b9e17f495
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user