-6 IP6_NETWORK Do ip6 nat for this network. ipv6 will work without nat,
but you may want it in certain circumstances.
-d Do not push dns
+-i INTERFACE_NAME name of tun interface
-n NAME default = server. 2 servers on the same host need different names.
-p PORT default 1194
-r Do not push default route
start=true
ip4=10.8.0
name=server
-temp=$(getopt -l help 4:6:dn:p:rsh "$@") || usage 1
+temp=$(getopt -l help 4:6:di:n:p:rsh "$@") || usage 1
eval set -- "$temp"
while true; do
case $1 in
-4) ip4=$2; shift 2 ;;
-6) ip6net=$2; shift 2 ;;
-d) dns=false; shift ;;
+ -i) ifname=$2; shift 2 ;;
-n) name=$2; shift 2 ;;
-p) port=$2; shift 2 ;;
-r) route=false; shift ;;
fi
fi
-
-gzip -dc /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz >$conf
+if [[ -e /usr/share/doc/openvpn/examples/sample-config-files/server.conf ]]; then
+ cat /usr/share/doc/openvpn/examples/sample-config-files/server.conf >$conf
+else
+ # pre-bullsye name
+ gzip -dc /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz >$conf
+fi
cafile=$server_dir/ca-$name.crt
cp $ca_origin $cafile
EOF
fi
+if [[ $ifname ]]; then
+ cat >>$conf <<EOF
+dev $ifname
+EOF
+fi
+
if [[ $ip6 ]]; then
cat >>$conf <<EOF
push tun-ipv6 # legacy option that flidas needs, has no harm.