OpenVPN linkup/down scripts, add IPv6 + ifconfig_local ipv4 route, for https://github.com/opnsense/core/issues/2799

This commit is contained in:
Ad Schellevis 2018-10-14 12:10:06 +02:00
parent 724f41dadb
commit 54f4ec89bb
2 changed files with 14 additions and 3 deletions

View File

@ -3,5 +3,6 @@
# delete the node just in case mpd cannot do that
/bin/rm -f /var/etc/nameserver_$1
/bin/rm -f /tmp/$1_router
/bin/rm -f /tmp/$1_routerv6
/bin/rm -f /tmp/$1up
/usr/local/opnsense/service/configd_ctl.py filter reload

View File

@ -4,11 +4,21 @@
# /usr/local/opnsense/service/configd_ctl.py interface newip $interface
if [ -n "${route_vpn_gateway}" ]; then
/bin/echo ${route_vpn_gateway} > /tmp/$1_router
/bin/echo ${route_vpn_gateway} > /tmp/$1_router
elif [ -n "${ifconfig_remote}" ]; then
/bin/echo ${ifconfig_remote} > /tmp/$1_router
/bin/echo ${ifconfig_remote} > /tmp/$1_router
elif [ -n "${ifconfig_local}" ]; then
/bin/echo ${ifconfig_local} > /tmp/$1_router
elif [ "${dev_type}" = "tun" ]; then
/bin/echo ${5} > /tmp/${1}_router
/bin/echo ${5} > /tmp/${1}_router
fi
if [ -n "${route_ipv6_gateway_1}" ]; then
/bin/echo ${route_ipv6_gateway_1} > /tmp/${1}_routerv6
elif [ -n "${ifconfig_ipv6_remote}" ]; then
/bin/echo ${ifconfig_ipv6_remote} > /tmp/${1}_routerv6
elif [ -n "${ifconfig_ipv6_local}" ]; then
/bin/echo ${ifconfig_ipv6_local} > /tmp/${1}_routerv6
fi
/usr/bin/touch /tmp/$1up