Skip to contentSkip to conversation

net6_gateway feature request

Openvpn-devel streampp 3 participants 5 messages Jul 16, 2016 – Jul 17, 2016 1 message not in the archive

lore
Share & tools
lore

streampp

author
#0 lore raw

Hello openvpn developers,

First of all, many thanks for such a great product.

I am wondering, is it possible to get something like "net6_gateway" parameter for pushing routes to client?

The problem is the following. I have a dual stack IPv4/IPv6 ethernet connection to my ISP. So I have native working IPv4 and IPv6. I have a remote OpenVPN server and I would like to route all my IPv4 and IPv6 traffic (except some networks) trough that OpenVPN. I'm connecting to my remote OpenVPN server via IPv4. On openvpn-server.conf I have something like:

push "route 10.0.0.0 255.0.0.0 net_gateway"
push "route 172.16.0.0 255.240.0.0 net_gateway"
push "route 192.168.0.0 255.255.0.0 net_gateway"

with works perfect and my IPv4 gateway replaces "net_gateway" parameter, so with IPv4 everything is fine.

But... I want same thing for IPv6:

push "route-ipv6 fc00::/64 net_gateway" and that is not working, because net_gateway represents IPv4 gateway...

Can you do something like "net6_gateway" variable for such cases? You may say, that "hey, dude, just do 2 server configs, one for IPv4 and one for IPv6", and I answer - no, I can't. Because at home I have dual stack IPv4/IPv6 network, and on Internet cafe or in a hotel I may not :(

So, any help would be appreciated, Many thanks.

streampp.

#1 lore raw

Hi,

Quoted 7 lines · streampp

I'm connecting to my remote OpenVPN server via IPv4. On openvpn-server.conf I have something like:

push "route 10.0.0.0 255.0.0.0 net_gateway"
push "route 172.16.0.0 255.240.0.0 net_gateway"
push "route 192.168.0.0 255.255.0.0 net_gateway"

with works perfect and my IPv4 gateway replaces "net_gateway" parameter, so with IPv4 everything is fine.

"why"?

Quoted 5 lines

But... I want same thing for IPv6:

push "route-ipv6 fc00::/64 net_gateway" and that is not working, because net_gateway represents IPv4 gateway...

Can you do something like "net6_gateway" variable for such cases?

By excluding that range (push "route-ipv6 2000::/3" instead of ::/0) you can achieve the same effect - fc00:: will go to your existing net_gateway.

But it still doesn't make very much sense to me why you want to exclude private ranges from the tunnel - why not just route everything?

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...

A message that is not in the archive (sent off-list or not yet received): [email protected]...

#3 lore raw

Hi,

Quoted 9 lines · streampp

Hello Gert, thanks for quick answer.

Quoted 7 lines · streampp
Quoted 6 lines

I'm connecting to my remote OpenVPN server via IPv4. On openvpn-server.conf I have something like:

push "route 10.0.0.0 255.0.0.0 net_gateway"
push "route 172.16.0.0 255.240.0.0 net_gateway"
push "route 192.168.0.0 255.255.0.0 net_gateway"

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

with works perfect and my IPv4 gateway replaces "net_gateway" parameter, so with IPv4 everything is fine.

"why"?

Didn't understand the question. :(

Why are you doing this?

Just because OpenVPN *can* do this for IPv4 doesn't mean it's a sensible thing to do - and in all my use cases I've never needed to do this, so it's not implemented for IPv6.

[..]

Quoted 3 lines

Ok, here we go.
Private network is just an example. Real case is: I have two openvpn's. One for work and one my personal. My personal OpenVPN to hosters VPS always ON, so all my internet traffic i encrypted. But when I enable OpenVPN from my work, it becomes OpenVPN over OpenVPN (work vpn over my personal one). I just want to avoid OpenVPN over OpenVPN :)

OK, that makes more sense - in both OpenVPN configs, you want to ensure that the *other* VPN server is routed via net_gateway(6). Indeed, convincing :-)

Unfortunately, not totally easy to do. While git master openvpn actually knows how to find the current default gateway (more precisely: the gateway used to reach the current VPN server's address, which might not be the default gateway if there is a more specific route in place) the whole IPv6 routing logic doesn't deal with symbolic names yet. Lots of pieces to extend (and test)...

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#4 lore raw
Quoted 6 lines · Gert Doering
Quoted 3 lines

Ok, here we go.

Quoted 2 lines

Private network is just an example. Real case is: I have two openvpn's. One for work and one my personal. My personal OpenVPN to hosters VPS always ON, so all my internet traffic i encrypted. But when I enable OpenVPN from my work, it becomes OpenVPN over OpenVPN (work vpn over my personal one). I just want to avoid OpenVPN over OpenVPN :)

OK, that makes more sense - in both OpenVPN configs, you want to ensure that the*other* VPN server is routed via net_gateway(6). Indeed, convincing :-)

If you *are* the client then you can customise your config & environment per site with (eg) --setenv my_route_net6_gateway blah:blah:blah::x

#5 lore raw

Hi,

Quoted 2 lines · On Sat, Jul 16, 2016 at 09:45:33PM +0100, debbie10t wrote:

If you *are* the client then you can customise your config & environment per site with (eg) --setenv my_route_net6_gateway blah:blah:blah::x

That would imply "someone has to write a script to figure out the default gateway across all supported platforms" - which is amazingly complicated...

But you bring up a good point - git master actually exports this information to scripts, via the "net_gateway_ipv6" environment variable. So, if the original poster can use git master, an --up script could install the necessary /128 routes towards net_gateway_ipv6.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...