Control external NAT creation

This commit is contained in:
Omri Iluz 2015-01-17 00:56:46 -08:00
parent 97f231b4e7
commit 1e2418ae37

View File

@ -42,6 +42,7 @@ usage() {
echo " -d Disable NAT routing and default route" echo " -d Disable NAT routing and default route"
echo " -c Enable client-to-client option" echo " -c Enable client-to-client option"
echo " -D Disable built in external dns (google dns)" echo " -D Disable built in external dns (google dns)"
echo " -N Configure NAT to access external server network"
} }
set -ex set -ex
@ -49,6 +50,7 @@ set -ex
OVPN_ENV=$OPENVPN/ovpn_env.sh OVPN_ENV=$OPENVPN/ovpn_env.sh
OVPN_SERVER=192.168.255.0/24 OVPN_SERVER=192.168.255.0/24
OVPN_DEFROUTE=1 OVPN_DEFROUTE=1
OVPN_NAT=0
OVPN_DNS=1 OVPN_DNS=1
OVPN_ROUTES=() OVPN_ROUTES=()
OVPN_PUSH=() OVPN_PUSH=()
@ -57,7 +59,7 @@ OVPN_PUSH=()
[ -r "$OVPN_ENV" ] && source "$OVPN_ENV" [ -r "$OVPN_ENV" ] && source "$OVPN_ENV"
# Parse arguments # Parse arguments
while getopts ":r:s:du:cp:D" opt; do while getopts ":r:s:du:cp:DN" opt; do
case $opt in case $opt in
r) r)
OVPN_ROUTES+=("$OPTARG") OVPN_ROUTES+=("$OPTARG")
@ -80,6 +82,9 @@ while getopts ":r:s:du:cp:D" opt; do
D) D)
OVPN_DNS=0 OVPN_DNS=0
;; ;;
N)
OVPN_NAT=1
;;
\?) \?)
set +x set +x
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2