Blocking outgoing IPv6 traffic from Android client
-
- OpenVpn Newbie
- Posts: 4
- Joined: Sat Nov 14, 2015 10:56 pm
Blocking outgoing IPv6 traffic from Android client
Hi,
I am encountering an issue when using the openvpn client for Android (on a 4.4.x device). The Android client is on a network that supports both ipv4 and ipv6, while the server only supports ipv4. VPN connection works fine over ipv4, but all ipv6 from the android client traffic leaks out of the tunnel, which is a problem.
I cannot disable ipv6 on the android device or it's network (I wouldn't mind disabling ipv6 for the whole network, but I am using an ISP-provided router and ipv6 is always enabled from the firmware). So what I am trying to do now is to push a custom route from the vpn server, to direct all ipv6 outgoing traffic from the android client to a black hole (when connected to the vpn, obviously). I am not even convinced this is possible, but my understanding of ipv6 routing is extremely limited, so I would appreciate any advice on this matter (my extensive internet searches led me to believe this is possible, but I do not understand exactly what needs to be done).
Any support will be kindly appreciated.
I am encountering an issue when using the openvpn client for Android (on a 4.4.x device). The Android client is on a network that supports both ipv4 and ipv6, while the server only supports ipv4. VPN connection works fine over ipv4, but all ipv6 from the android client traffic leaks out of the tunnel, which is a problem.
I cannot disable ipv6 on the android device or it's network (I wouldn't mind disabling ipv6 for the whole network, but I am using an ISP-provided router and ipv6 is always enabled from the firmware). So what I am trying to do now is to push a custom route from the vpn server, to direct all ipv6 outgoing traffic from the android client to a black hole (when connected to the vpn, obviously). I am not even convinced this is possible, but my understanding of ipv6 routing is extremely limited, so I would appreciate any advice on this matter (my extensive internet searches led me to believe this is possible, but I do not understand exactly what needs to be done).
Any support will be kindly appreciated.
-
- OpenVPN Protagonist
- Posts: 11139
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Blocking outgoing IPv6 traffic from Android client
There is some information here:
https://community.openvpn.net/openvpn/wiki/IPv6
There is some bad news at the bottom of that page ..
https://community.openvpn.net/openvpn/wiki/IPv6
There is some bad news at the bottom of that page ..
-
- OpenVpn Newbie
- Posts: 4
- Joined: Sat Nov 14, 2015 10:56 pm
Re: Blocking outgoing IPv6 traffic from Android client
I've read that, but it only says that a vpn connection does not work over ipv6. that's fine, my problem is that the connection works outside the tunnel when connected to the vpn
what I need is to make it NOT work both through and out of the vpn tunnel.

-
- OpenVPN Protagonist
- Posts: 11139
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Blocking outgoing IPv6 traffic from Android client
If you control the server then use that previous link to redirect all the client IPv6 (and IPv4) then discard the IPv6 at the server ..born2lose wrote:what I am trying to do now is to push a custom route from the vpn server, to direct all ipv6 outgoing traffic from the android client to a black hole
-
- OpenVpn Newbie
- Posts: 4
- Joined: Sat Nov 14, 2015 10:56 pm
Re: Blocking outgoing IPv6 traffic from Android client
that makes sense, but I cannot redirect ipv6 traffic to the server, because the server does not have an ipv6 address. that's how I ended up asking this question - the only thing I can do now on the server side is to push custom routes via the config file. I just don't know what routes to push 
p.s. I've loaded the exact same profile on an ios device - and it works perfectly. if I check my ip on various ipv6 lookup sites - without being connected to the vpn - both my ipad and my android will return similar ipv6 addresses. repeating the same test after connecting to the vpn, the ipad will show the ipv4 external ip address of my server, while android will return the same ipv6 address as in the previous test. so there must be some differences in the clients...

p.s. I've loaded the exact same profile on an ios device - and it works perfectly. if I check my ip on various ipv6 lookup sites - without being connected to the vpn - both my ipad and my android will return similar ipv6 addresses. repeating the same test after connecting to the vpn, the ipad will show the ipv4 external ip address of my server, while android will return the same ipv6 address as in the previous test. so there must be some differences in the clients...
-
- OpenVPN Protagonist
- Posts: 11139
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Blocking outgoing IPv6 traffic from Android client
The server does not need an IPv6 address, so long as openvpn can assign it one for inside the tunnel.
-
- OpenVpn Newbie
- Posts: 5
- Joined: Wed Nov 29, 2017 10:52 pm
Re: Blocking outgoing IPv6 traffic from Android client
Sorry to bump an old thread, but I'm in the same predicament as you are. Found a way to make it work? Mind sharing the configs?
-
- OpenVPN Protagonist
- Posts: 11139
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Blocking outgoing IPv6 traffic from Android client
To re-iterate this problem (and a likely solution for you abc...).
TinCanTech wrote: ↑Fri Jul 08, 2016 6:17 pmThere is some information here:
https://community.openvpn.net/openvpn/wiki/IPv6
There is some bad news at the bottom of that page ..
TinCanTech wrote: ↑Fri Jul 08, 2016 7:03 pmIf you control the server then use that previous link to redirect all the client IPv6 (and IPv4) then discard the IPv6 at the server ..born2lose wrote:what I am trying to do now is to push a custom route from the vpn server, to direct all ipv6 outgoing traffic from the android client to a black hole
TinCanTech wrote: ↑Fri Jul 08, 2016 9:44 pmThe server does not need an IPv6 address, so long as openvpn can assign it one for inside the tunnel.
The OP here never reported back but never posted again so I presume it worked .. try it for yourself and let us know.abcdefghijklmnopqryz wrote: ↑Thu Nov 30, 2017 9:17 amSorry to bump an old thread, but I'm in the same predicament as you are. Found a way to make it work? Mind sharing the configs?
-
- OpenVpn Newbie
- Posts: 5
- Joined: Wed Nov 29, 2017 10:52 pm
Re: Blocking outgoing IPv6 traffic from Android client
I did do that - I end up closing the IPv6 Leak - but then end up being able to only send small packets...TinCanTech wrote: ↑Thu Nov 30, 2017 1:20 pmIf you control the server then use that previous link to redirect all the client IPv6 (and IPv4) then discard the IPv6 at the server ..
-
- OpenVpn Newbie
- Posts: 5
- Joined: Wed Nov 29, 2017 10:52 pm
Re: Blocking outgoing IPv6 traffic from Android client
Update: Ended up solving my own problem, as always, thanks but no thanks Reddit, Github, Forums!
For future readers wanting to disable IPv6 - I solved my problem by realizing that as soon as I covered the leak (routing ipv6 in client ovpn), I ran into another issue with the MTU, as small packets were being delivered, larger ones dropped (in retrospect, makes sense since IPv6 = larger packets).
Ended up comparing my config with a VPN service (account holder)'s ovpn file to try and pinpoint what could be changed in the config. Turns out mssfix was what I was looking for.
Update TL;DR: route ipv6 & add mssfix to the client ovpn file - many guides online to finding that value.
For future readers wanting to disable IPv6 - I solved my problem by realizing that as soon as I covered the leak (routing ipv6 in client ovpn), I ran into another issue with the MTU, as small packets were being delivered, larger ones dropped (in retrospect, makes sense since IPv6 = larger packets).
Ended up comparing my config with a VPN service (account holder)'s ovpn file to try and pinpoint what could be changed in the config. Turns out mssfix was what I was looking for.
Update TL;DR: route ipv6 & add mssfix to the client ovpn file - many guides online to finding that value.