OpenVPN leaks IPV6 in Ubuntu but not in android

J. Polo asked:

First of all I would like to say that I am a complete beginner in this topic.

I have been trying for several hours to allow my system to connect to my VPN (I have a raspberry pi with the basic configuration of OpenVPN) without leaking my IPv6 but I haven’t found a way.

I can connect to my server normally and using https://ipleak.net/ for instance I can see that I have the ip of the remote server but the Ipv6 still remains the same as when not using OpenVPN.

I have tried to disable IPv6 with “sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1” but then for some reason I cannot connect to internet when I use OpenVPN (nonetheless the local network works).

However, in my android phone with the OpenVPN app I can connect to internet with no IPv6 leakage and even I can be sure to block it through its settings.

Is there any option to block IPv6 from the client as in the Android app?

I put a bit more info of my configuration:

In the client.ovpn

client
dev tun
proto udp
remote #"MY_IP_AND_PORT"
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ns-cert-type server
comp-lzo
verb 3

In the server.conf

port ######
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.1.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS ###.##.###.###"
push "dhcp-option DNS ###.##.###.###"
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
sndbuf 393216
rcvbuf 393216
push "sndbuf 393216"
push "rcvbuf 393216"

Thanks in advance.

My answer:


Your server is not providing any IPv6 addresses to its clients. You need to fix that using an appropriate server-ipv6 directive.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.