Pushing IPV6 configuration to a client not supporting IPV6

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
pette_rsson
OpenVpn Newbie
Posts: 4
Joined: Tue Apr 16, 2013 7:58 am

Pushing IPV6 configuration to a client not supporting IPV6

Post by pette_rsson » Tue Apr 16, 2013 8:01 am

I am connecting to a VPN provider that supports IPV6. My configuration does not support it, and I just want the IPV4 setup.

On connect, the server pushes routes and ifconfig with IPv6 data to the client and making it crash.

I have not specified tun-ipv6 in the client configuration, and I got a warning about that the server and client config does not match. But shouldn't it be enough to not specify this option in the client config to make it ignore IPv6 commands pushed by the server?

Is it totally impossible to connect to a IPv6 ready server with a IPv4 only client? If not, how can I make it ignore the pushed commands?

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Pushing IPV6 configuration to a client not supporting IP

Post by janjust » Tue Apr 16, 2013 1:15 pm

you can prevent the pulling of routes using

Code: Select all

route-nopull
you can overrule the pulling of *anything* by not specifying "client" in the client config; specify

Code: Select all

tls-client
instead; you will be responsible for setting up the link , however.

An alternative is to use an "up" script and use

Code: Select all

ifconfig-noexec
to have openvpn not automatically bring up the interface.

pette_rsson
OpenVpn Newbie
Posts: 4
Joined: Tue Apr 16, 2013 7:58 am

Re: Pushing IPV6 configuration to a client not supporting IP

Post by pette_rsson » Tue Apr 16, 2013 2:52 pm

OK, thank you. I guess that is an option, but I want some routes (all IPv4 routes) and the IPv4 IP, so I would have to make a more or less intelligent script then.

Would it be possible to make openvpn ignore this error;
Linux ifconfig inet6 failed: external program exited with error status: 1
and continue? That would solve my issues as well.

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Pushing IPV6 configuration to a client not supporting IP

Post by janjust » Tue Apr 16, 2013 3:13 pm

you'll have to use

Code: Select all

ifconfig-noexec
up /etc/openvpn/ipv4-up.sh
this scrilpt will be called with parameters

Code: Select all

tun/tap-dev tun-mtu link-mtu ifconfig-local-ip ifconfig-remote-ip
and perhaps a few more, so the script needs to do something like

Code: Select all

#!/bin/bash

/sbin/ifconfig $1 $4 $5 mtu $2

pette_rsson
OpenVpn Newbie
Posts: 4
Joined: Tue Apr 16, 2013 7:58 am

Re: Pushing IPV6 configuration to a client not supporting IP

Post by pette_rsson » Tue Apr 16, 2013 3:27 pm

Yes, thank you.

Which and in what order of parameters is the route script called with? How would an example of a route script look?

User avatar
janjust
Forum Team
Posts: 2703
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Pushing IPV6 configuration to a client not supporting IP

Post by janjust » Tue Apr 16, 2013 3:29 pm

I'd try it first with the "regular" route script, i.e. don't use "route-nopull" but simply let openvpn take care of it - failures in the 'route' commands do NOT cause openvpn to abort.

pette_rsson
OpenVpn Newbie
Posts: 4
Joined: Tue Apr 16, 2013 7:58 am

Re: Pushing IPV6 configuration to a client not supporting IP

Post by pette_rsson » Tue Apr 16, 2013 5:47 pm

Thanks again.

As expected you were right.

It works OK now, with this ifconfig-up script:

Code: Select all

#!/bin/sh
/sbin/ifconfig $dev $ifconfig_local netmask $ifconfig_netmask mtu 1500 broadcast $ifconfig_broadcast
Thank you

Post Reply