From 3eeee022fd5a91af8594de3ebbc02d946eb9cdde Mon Sep 17 00:00:00 2001 From: Omri Iluz Date: Sat, 17 Jan 2015 01:00:18 -0800 Subject: [PATCH] Create NAT if OVPN_NAT is set (flag -N) --- bin/ovpn_run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ovpn_run b/bin/ovpn_run index 0d1adc6..78ce09d 100755 --- a/bin/ovpn_run +++ b/bin/ovpn_run @@ -18,7 +18,7 @@ if [ ! -d "$OPENVPN/ccd" ]; then fi # Setup NAT forwarding if requested -if [ "$OVPN_DEFROUTE" != "0" ];then +if [ "$OVPN_DEFROUTE" != "0" ] || [ "$OVPN_NAT" == "1" ] ; then iptables -t nat -C POSTROUTING -s $OVPN_SERVER -o eth0 -j MASQUERADE || { iptables -t nat -A POSTROUTING -s $OVPN_SERVER -o eth0 -j MASQUERADE }