Support client mtu push

This commit is contained in:
omriiluz 2015-01-17 01:07:52 -08:00
parent 3eeee022fd
commit 1cb38ce146
2 changed files with 8 additions and 2 deletions

View File

@ -43,6 +43,7 @@ usage() {
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" echo " -N Configure NAT to access external server network"
echo " -m Set client MTU"
} }
set -ex set -ex
@ -59,7 +60,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:DN" opt; do while getopts ":r:s:du:cp:DNm:" opt; do
case $opt in case $opt in
r) r)
OVPN_ROUTES+=("$OPTARG") OVPN_ROUTES+=("$OPTARG")
@ -85,6 +86,9 @@ while getopts ":r:s:du:cp:DN" opt; do
N) N)
OVPN_NAT=1 OVPN_NAT=1
;; ;;
m)
OVPN_MTU=$OPTARG
;;
\?) \?)
set +x set +x
echo "Invalid option: -$OPTARG" >&2 echo "Invalid option: -$OPTARG" >&2
@ -120,7 +124,7 @@ fi
export OVPN_SERVER OVPN_ROUTES OVPN_DEFROUTE export OVPN_SERVER OVPN_ROUTES OVPN_DEFROUTE
export OVPN_SERVER_URL OVPN_ENV OVPN_PROTO OVPN_CN OVPN_PORT export OVPN_SERVER_URL OVPN_ENV OVPN_PROTO OVPN_CN OVPN_PORT
export OVPN_CLIENT_TO_CLIENT OVPN_PUSH export OVPN_CLIENT_TO_CLIENT OVPN_PUSH OVPN_NAT OVPN_DNS OVPN_MTU
# Preserve config # Preserve config
if [ -f "$OVPN_ENV" ]; then if [ -f "$OVPN_ENV" ]; then

View File

@ -43,3 +43,5 @@ EOF
if [ "$OVPN_DEFROUTE" != "0" ];then if [ "$OVPN_DEFROUTE" != "0" ];then
echo "redirect-gateway def1" echo "redirect-gateway def1"
fi fi
[ -n "$OVPN_MTU" ] && echo "tun-mtu $OVPN_MTU"