diff --git a/src/etc/inc/plugins.inc.d/openvpn/ovpn-linkdown b/src/etc/inc/plugins.inc.d/openvpn/ovpn-linkdown index f4855db17..fbff4733a 100755 --- a/src/etc/inc/plugins.inc.d/openvpn/ovpn-linkdown +++ b/src/etc/inc/plugins.inc.d/openvpn/ovpn-linkdown @@ -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 diff --git a/src/etc/inc/plugins.inc.d/openvpn/ovpn-linkup b/src/etc/inc/plugins.inc.d/openvpn/ovpn-linkup index 0ed10af50..3938b13ad 100755 --- a/src/etc/inc/plugins.inc.d/openvpn/ovpn-linkup +++ b/src/etc/inc/plugins.inc.d/openvpn/ovpn-linkup @@ -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