IPv6 leak through a VPN

A common leak: all traffic goes through the VPN, yet a site still sees your real IPv6 address. It happens when your ISP hands out IPv6 and the tunnel only carries IPv4. First check if you have IPv6 at all: if not, there is nothing to leak.

Updated

On this page

Do you have IPv6 at all

Look at the addresses of your network adapter. A global IPv6 address starts with 2 or 3, for example 2a02:… or 2001:…. Addresses starting with fe80 work only inside your own network and can't leak. Neither can addresses starting with fd or fc.

Windows: PowerShell or cmd
ipconfig

Look for "IPv6 Address" lines on your Wi-Fi or Ethernet adapter. "Link-local IPv6 Address" with fe80 doesn't count.

macOS: Terminal
ifconfig | grep inet6
Linux: Terminal
ip -6 addr show scope global

How to check for a leak

  1. 1

    Connect the VPN

    Without the VPN a site should see your address.

  2. 2

    See which addresses sites see

    In Veli it's Diagnostics → Privacy. In a browser, any site that shows both IPv4 and IPv6.

  3. 3

    Compare the addresses

    If IPv4 is the VPN server's and IPv6 is your own, there is a leak.

Check with two commands

The first command asks for your address over IPv4 only, the second over IPv6 only. Run them with the VPN connected.

Windows: PowerShell or cmd
curl.exe -4 https://api.ipify.org
curl.exe -6 https://api6.ipify.org
macOS and Linux: Terminal
curl -4 https://api.ipify.org
curl -6 https://api6.ipify.org
  • IPv4 is the server's, IPv6 fails with "Couldn't connect"

    What it meansNo leak: IPv6 is closed or you don't have it

  • IPv4 is the server's, IPv6 is the server's

    What it meansNo leak: the tunnel carries IPv6 too

  • IPv4 is the server's, IPv6 is yours

    What it meansA leak: IPv6 goes past the tunnel

  • IPv4 is your own

    What it meansNot an IPv6 problem: traffic doesn't go through the VPN at all. Check the routing mode

Why IPv6 goes around the tunnel

A computer can have two addresses: IPv4 and IPv6. If the VPN carries only IPv4 through the tunnel and nobody closed IPv6, sites that speak IPv6 reach you directly and see your real address.

This is not a rare case. When both are available, browsers and systems try IPv6 first. Google, YouTube, Facebook, Netflix and sites behind Cloudflare all have IPv6, so with a leak a large part of your traffic goes past the tunnel.

How to fix it

  • Use a VPN profile that carries IPv6 through the tunnel too.
  • Or turn off IPv6 in the system's network settings: IPv4 is enough for most sites. Commands for each system are below.
  • Or turn off IPv6 on the router: then it's off for the whole home network at once.
  • After the change, reconnect the VPN and check again.

Turning off IPv6 on each system

On Android IPv6 can't simply be switched off. Some operators let you set the protocol to IPv4 in the access point (APN) settings. It's easier to check with the VPN on whether the address changed.

Windows: PowerShell as administrator
Disable-NetAdapterBinding -Name "Wi-Fi" -ComponentID ms_tcpip6

Put your adapter's name instead of Wi-Fi: Get-NetAdapter lists them. To turn IPv6 back on, run the same command with Enable-NetAdapterBinding. Without a command: adapter properties → untick "Internet Protocol Version 6 (TCP/IPv6)".

macOS: Terminal
networksetup -setv6off Wi-Fi

Back on: networksetup -setv6automatic Wi-Fi. For a cable connection, put the service name from networksetup -listallnetworkservices.

Linux: Terminal
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1

This works until a reboot. To keep it, put the same line without sudo sysctl -w into a file in /etc/sysctl.d/.

In Veli

The leak shows right away

In Veli, the Privacy tile in Diagnostics says “There is a leak” if sites see your IPv6. It also shows which address and DNS sites see.

If the address didn't change at all, check the routing mode: in "only selected through the VPN" mode the browser may have gone direct.

FAQ

I don't have IPv6. Can there be a leak?

No: if your ISP doesn't give you IPv6, there is nothing to leak. The check will show only IPv4.

Is it safe to turn off IPv6?

Yes, IPv4 is enough for everyday use. If some service needs IPv6, better use a VPN profile that carries IPv6 through the tunnel.

Does a kill switch protect against an IPv6 leak?

A kill switch lets no traffic past the tunnel while the VPN is on. But it's safer to check: the Privacy tile will tell you for sure.

Is a WebRTC leak the same thing?

No, it's another leak: the browser can tell a site your addresses through WebRTC, the technology for calls. When all traffic goes through the VPN, WebRTC shows the server's address. In "only selected through the VPN" mode the browser goes direct anyway.

An IPv6 leak shows in one tile

The Privacy tile in Diagnostics says “There is a leak” if sites see your real IPv6.