pekman / openvpn-netns

Start OpenVPN connection inside Linux network namespace
The Unlicense
66 stars 12 forks source link

Default route for ipv6 #1

Closed victornoel closed 7 years ago

victornoel commented 7 years ago

Hi,

I don't use ipv6 with my vpn, but I noticed in your code that you don't set up de default ipv6 route.

According to http://www.naju.se/articles/openvpn-netns, the command would be:

ip netns exec vpn ip route add default via "$ifconfig_ipv6_remote"

Hope this makes sense and helps :)

pekman commented 7 years ago

Thanks for the suggestion. I don't use IPv6 with my VPN either, and the IPv6 parts of the script are not properly tested.

I'm not convinced that using $ifconfig_ipv6_remote is the correct way to set the default route. The correct way would of course be to do whatever OpenVPN normally does, but that doesn't seem to be well documented. Correct or not, $ifconfig_ipv6_remote seems like a reasonable default value for default gateway as long as any explicit default route in $route_ipv6_network_* overrides it.

I added code that does that. Also, because the code is still untested, IPv6 is now disabled by default.