diff --git a/bin/ovpn_run b/bin/ovpn_run index 0112a0e..14db9f0 100755 --- a/bin/ovpn_run +++ b/bin/ovpn_run @@ -35,6 +35,9 @@ function addArg { fi } +# set up iptables rules and routing +# this allows rules/routing to be altered by supplying this function +# in an included file, such as ovpn_env.sh function setupIptablesAndRouting { iptables -t nat -C POSTROUTING -s $OVPN_SERVER -o $OVPN_NATDEVICE -j MASQUERADE || { iptables -t nat -A POSTROUTING -s $OVPN_SERVER -o $OVPN_NATDEVICE -j MASQUERADE @@ -65,6 +68,9 @@ fi # Setup NAT forwarding if requested if [ "$OVPN_DEFROUTE" != "0" ] || [ "$OVPN_NAT" == "1" ] ; then + # call function to setup iptables rules and routing + # this allows rules to be customized by supplying + # a replacement function in, for example, ovpn_env.sh setupIptablesAndRouting fi