# Unlike with iproute2, there is no way to determine which current
# route(s) match the VPN gateway, so we simply find a default
# route and use its gateway.
- route add -host "$VPNGATEWAY" $route_syntax_gw "`get_default_gw`"
+ case "$VPNGATEWAY" in
+ *:*) route add -inet6 -host "$VPNGATEWAY" $route_syntax_gw "`get_ipv6_default_gw`";;
+ *.*) route add -host "$VPNGATEWAY" $route_syntax_gw "`get_default_gw`";;
+ esac
}
set_vpngateway_route_attempt_reconnect() {
}
del_vpngateway_route() {
- route $route_syntax_del -host "$VPNGATEWAY" $route_syntax_gw "`get_default_gw`"
+ case "$VPNGATEWAY" in
+ *:*) route $route_syntax_del -inet6 -host "$VPNGATEWAY" $route_syntax_gw "`get_ipv6_default_gw`";;
+ *.*) route $route_syntax_del -host "$VPNGATEWAY" $route_syntax_gw "`get_default_gw`";;
+ esac
}
set_default_route() {
route $route_syntax_del -net "$NETWORK" $route_syntax_netmask "$NETMASK" $route_syntax_gw "$NETGW"
}
+ get_ipv6_default_gw() {
+ # isn't -n supposed to give --numeric output?
+ # apperently not...
+ netstat -r -n -f inet6 | awk '/^(default|::\/0)/ { print $2"%"$NF; }'
+ }
+
set_ipv6_default_route() {
- route add -inet6 default "$INTERNAL_IP6_ADDRESS" $route_syntax_interface
+ route add -inet6 ::/1 "$INTERNAL_IP6_ADDRESS" $route_syntax_interface
+ route add -inet6 8000::/1 "$INTERNAL_IP6_ADDRESS" $route_syntax_interface
}
set_ipv6_network_route() {
# Add explicit route to keep traffic for this target separate
# from tunnel. FIXME: We use default gateway - this is our best
# guess in absence of "ip" command to query effective route.
- route add -inet6 -net "$NETWORK/$NETMASK" "`get_default_gw`" $route_syntax_interface
+ route add -inet6 -net "$NETWORK/$NETMASK" "`get_ipv6_default_gw`" $route_syntax_interface
:
}
reset_ipv6_default_route() {
- route $route_syntax_del -inet6 default "$INTERNAL_IP6_ADDRESS"
+ route $route_syntax_del -inet6 ::/1 "$INTERNAL_IP6_ADDRESS"
+ route $route_syntax_del -inet6 8000::/1 "$INTERNAL_IP6_ADDRESS"
:
}
INTERNAL_IP6_NETMASK="$INTERNAL_IP6_ADDRESS/128"
fi
if [ -n "$INTERNAL_IP6_NETMASK" ]; then
- ifconfig "$TUNDEV" inet6 del $INTERNAL_IP6_NETMASK
+ ifconfig "$TUNDEV" inet6 delete $INTERNAL_IP6_NETMASK
fi
fi