AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

i365Finds Editorial is the independent research and editorial organization behind 365 Wiki. We follow changes in tools, products, services, entertainment, and digital life around the world, turning scattered and fast-moving information into clearly sourced, well-structured public content that is easier to understand and compare.
Indexed 90,360 Wiki articles

Why Native IPv6 Prefix Delegation Bypasses Router VPNs and How to Stop Dual-Stack Leaks

Betsy Paoletta · 365Finds Editorial

A home router connected to a VPN tunnel can still betray your physical location on every major website you visit. At 365Finds, we have dissected countless consumer network setups where users carefully configured WireGuard or OpenVPN on an Asuswrt-Merlin box or OpenWrt gateway, stared at a green "Connected" indicator, and assumed every device behind the LAN was cloaked. It often is not. If your Internet Service Provider assigns an IPv6 prefix through DHCPv6 Prefix Delegation (DHCPv6-PD), your devices are likely speaking cleartext IPv6 directly through the ISP gateway, rendering your VPN wrapper completely ornamental for dual-stack traffic.

This silent bypass is neither a bug in your operating system nor a malfunction of WireGuard. It is the predictable result of two internet standards colliding on home hardware: an ISP infrastructure designed to give every endpoint a globally unique, un-NATed IPv6 address, and consumer router VPN clients engineered almost entirely around IPv4 Network Address Translation.


The Mechanics: How DHCPv6-PD and SLAAC Punch Through Tunnels

In traditional IPv4 networking, your router receives a single public address on its WAN port. LAN devices occupy private subnets (RFC 1918 ranges such as 192.168.1.0/24). To push LAN traffic through a VPN, the router simply alters its default gateway (0.0.0.0/0) to point to the virtual network adapter (tun0 or wg0) and applies source NAT (masquerading). The client devices remain oblivious to the outside world; they simply forward packets to the router's local gateway address.

IPv6 eliminates NAT by design. When your home router establishes its WAN link, it requests an IPv6 prefix from the ISP using DHCPv6 Prefix Delegation. The ISP typically responds with a /56 or /60 block containing millions of globally routable addresses.

The router breaks this delegation into /64 subnets and assigns one to the local bridge interface. Next, the router's advertisement daemon—such as odhcpd on OpenWrt, dnsmasq on Asuswrt, or radvd on pfSense—begins multicasting ICMPv6 Router Advertisements across your LAN.

Through Stateless Address Autoconfiguration (SLAAC, formalized in RFC 4862), every smartphone, laptop, console, and smart television on your home network constructs its own Global Unicast Address (GUA) directly from the ISP prefix. In addition, the Router Advertisement informs these clients of their default IPv6 gateway: the link-local address (fe80::...) of the router's LAN interface.

+---------------------------------------------------------------------------------------+
|                                    HOME ROUTER                                        |
|                                                                                       |
|  [ ISP WAN6 ] <==== DHCPv6-PD (/56 or /60) <==== Native ISP Fibre / Cable Gateway     |
|       |                                                                               |
|       v (Delegates /64 via odhcpd / SLAAC)                                            |
|  [ LAN Bridge ] ====> Distributes Public GUAs to PC / Phone                           |
|                                                                                       |
|  [ VPN Tunnel (wg0) ] ====> Receives IPv4 (0.0.0.0/0) [IPv6: Ignored or Dropped]      |
|                                                                                       |
|  ROUTING TABLE DECISION:                                                              |
|   - Destination IPv4  --> Matches 0.0.0.0/0  --> Forwarded to [ VPN Tunnel wg0 ]     |
|   - Destination IPv6  --> Matches ::/0       --> Forwarded to [ Native ISP Gateway ]  |
+---------------------------------------------------------------------------------------+

When you turn on a VPN client on the router, the firmware creates a tunnel interface and updates the IPv4 routing table. But in the vast majority of commercial VPN setups, the router's IPv6 routing table is left untouched. The VPN provider either does not support IPv6 routing or offers only a single /128 tunnel address with no prefix delegation for LAN distribution.

Meanwhile, your router's kernel maintains two independent routing tables:

  1. IPv4: The default route (0.0.0.0/0) points through the VPN tunnel interface.
  2. IPv6: The default route (::/0) remains firmly anchored to the ISP's upstream gateway on the physical WAN interface (wan6 or pppoe-wan).

Your router does not actively hide this dual reality; it routes exactly what each protocol asks for.


Why Client Operating Systems Choose the Leak

Given a choice between an encrypted IPv4 tunnel and an unencrypted native IPv6 route, modern client operating systems will almost always pick the unencrypted path. This behavior is governed by two core networking standards:

1. RFC 6724: Default Address Selection

Operating systems maintain a policy table to decide which IP version to use when an application requests a destination. Under RFC 6724, standard native IPv6 Global Unicast Addresses carry a precedence score of 40, whereas IPv4-mapped addresses have a precedence score of 35. Native IPv6 takes priority over IPv4 whenever a host possesses a functional GUA.

2. RFC 8305: Happy Eyeballs Version 2

When you type a domain like netflix.com, google.com, or any major service into your browser, the resolver issues parallel queries for IPv4 (A) records and IPv6 (AAAA) records.

RFC 8305 mandates that client engines sort these addresses based on RFC 6724 and initiate connections concurrently, deliberately granting IPv6 a connection head start (typically 25 to 50 milliseconds). Because your ISP-provided native IPv6 path has low local latency, the IPv6 handshake completes before the IPv4 tunnel connection even finishes traversing the VPN server.

The client's browser connects over raw IPv6. The packet leaves the client stamped with its ISP-delegated public IPv6 source address, hits the router, matches the native ::/0 route, and flies across the ISP WAN unencrypted. The destination server logs your ISP's Autonomous System Number (ASN), your residential subnet, and your physical neighborhood, while your desktop VPN widget happily reports that your IP is masked in Zurich or Singapore.


Strategy 1: The WAN Blackhole (Firewall Drop and Kill-Switch)

For most users, 365Finds recommends the firewall blackhole. If your VPN provider does not support dual-stack routing—or if you refuse to tolerate the risk of configuration drift—the cleanest response is to allow local IPv6 communication while aggressively dropping any IPv6 traffic attempting to transit the physical WAN interface.

OpenWrt (fw4 / nftables)

OpenWrt 22.03 and later versions use fw4 powered by nftables. To prevent LAN clients from sending forwarded IPv6 traffic out of the native WAN, you can insert an explicit reject or drop rule in /etc/config/firewall:

config rule
    option name 'Block-LAN-to-WAN-IPv6-Leak'
    option src 'lan'
    option dest 'wan'
    option family 'ipv6'
    option target 'REJECT'

Alternatively, if you want an absolute kill-switch that prevents un-tunneled forward traffic under any condition, you can edit /etc/nftables.d/ or add a forward filter rule:

# Drop all IPv6 traffic attempting to exit physical wan interfaces
nft add rule inet fw4 forward oifname "eth0.2" meta nfproto ipv6 drop

After modifying the configuration, reload the firewall subsystem:

uci commit firewall
/etc/init.d/firewall restart

Asuswrt-Merlin

Asuswrt-Merlin handles policy routing via VPN Director, but VPN Director operates on IPv4 source and destination rules. If IPv6 is left enabled under Advanced Settings > IPv6, client traffic destined for IPv6 targets will bypass VPN Director rules entirely.

To prevent leaks on Asuswrt-Merlin:

  1. The Absolute Method: Navigate to Advanced Settings > IPv6 and set Connection type to Disabled. This halts dnsmasq from issuing Router Advertisements and forces all connected hardware onto the IPv4 stack, where VPN Director policies apply without leakage.
  2. The Scripted Firewall Drop: If you must preserve IPv6 for local file sharing, write a custom /jffs/scripts/firewall-start script:
    #!/bin/sh
    # Block forward traffic originating from LAN destined out the physical WAN interface
    ip6tables -I FORWARD -i br0 -o eth0 -j DROP
    
    Make the script executable (chmod +x /jffs/scripts/firewall-start) and reboot.

Strategy 2: Taming SLAAC and Router Advertisements

Blocking traffic at the firewall prevents packets from reaching the internet, but if your router continues advertising itself as a default IPv6 gateway, client applications will waste 25 to 50 milliseconds on every single request waiting for the dropped IPv6 handshake to time out before Happy Eyeballs falls back to IPv4.

To eliminate this latency penalty, you must adjust the Router Advertisement parameters defined in RFC 4862 and RFC 8106.

Setting Router Lifetime to Zero

An ICMPv6 Router Advertisement contains a Router Lifetime field. If this field is non-zero, endpoints add the router to their default route list (::/0). If the field is set to 0, clients recognize that the router is not an IPv6 gateway to the broader internet. They will still assign themselves Unique Local Addresses (ULA) or link-local addresses for internal communication, but RFC 6724 will demote IPv6, causing the OS to immediately prefer the IPv4 VPN tunnel.

In OpenWrt's /etc/config/dhcp:

config dhcp 'lan'
    option interface 'lan'
    option ra 'server'
    option ra_default '0'
    option dhcpv6 'disabled'

Setting ra_default to 0 tells odhcpd to broadcast RAs without advertising default router capability, immediately stopping the host stack from attempting direct WAN breakout.

Eliminating DNS Leaks via RDNSS (RFC 8106)

Even when data traffic is contained, your router might advertise your ISP's IPv6 Recursive DNS Server (RDNSS) in its Router Advertisements. Dual-stack devices will dispatch DNS queries over native IPv6 to your ISP's resolver, exposing every domain you look up.

In OpenWrt, verify that odhcpd does not push upstream ISP resolvers downstream. Under /etc/config/dhcp, configure local DNS distribution only, or disable RDNSS propagation altogether:

config dhcp 'lan'
    option ra_dns '0'

Strategy 3: Full-Tunnel Dual-Stack Routing (NAT66 and Prefix Delegation)

If your VPN provider genuinely supports IPv6, you do not need to cut off the protocol. However, routing IPv6 through a consumer router tunnel requires understanding the difference between routed prefixes and single addresses.

Architecture OptionConfiguration ComplexityLeak ProtectionLocal LAN IPv6 MaintainedHappy Eyeballs Latency Penalty
Disable IPv6 GloballyMinimal (One toggle in UI)Absolute (Zero attack surface)No (Pure IPv4 network)None (Immediate IPv4 selection)
Firewall WAN BlackholeModerate (Firewall rules)Absolute (Packets dropped at egress)Yes (Link-local & ULA operational)Slight (~25-50ms until timeout fallback)
Zero-Lifetime SLAACModerate (RA daemon config)High (Prevents default route creation)Yes (Internal subnet stays live)None (OS favors IPv4 cleanly)
VPN NAT66 MasqueradeHigh (Policy routing & NAT66)Absolute (Encapsulated in tunnel)Yes (LAN assigned ULA or tunnel prefix)None (True dual-stack tunnel)

The /128 Dilemma: Why NAT66 Is Required

Almost all commercial VPN providers that support IPv6 on WireGuard (such as Mullvad or IVPN) allocate a single /128 IPv6 address to the tunnel interface. A /128 address represents a single host; it cannot be split or routed down to multiple devices on your LAN.

Because you cannot hand individual public addresses to your LAN hardware, you must treat IPv6 exactly like IPv4: by assigning Unique Local Addresses (fd00::/8) to your LAN devices and running IPv6 masquerading (NAT66) on the VPN tunnel interface.

To achieve this on OpenWrt:

  1. Assign a Unique Local Address Prefix: In /etc/config/network, ensure a stable ULA prefix is defined:

    config globals 'globals'
        option ula_prefix 'fd12:3456:789a::/48'
    
  2. Configure the WireGuard VPN Interface: Ensure your WireGuard interface definition includes both IPv4 and IPv6 tunnel addresses:

    config interface 'wg_vpn'
        option proto 'wireguard'
        option private_key 'CLIENT_PRIVATE_KEY'
        list addresses '10.2.0.2/32'
        list addresses 'fc00:bbbb:cccc::2/128'
    
  3. Enable IPv6 Masquerading (masq6) on the Firewall Zone: In /etc/config/firewall, locate the zone assigned to your VPN interface and activate 64-bit masquerading:

    config zone
        option name 'vpn'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option masq6 '1'
        list network 'wg_vpn'
    
  4. Policy-Based Routing for IPv6: Instruct the kernel to route outgoing LAN IPv6 packets through the VPN routing table instead of the native WAN table:

    ip -6 rule add from fd12:3456:789a::/64 lookup 200
    ip -6 route add default dev wg_vpn table 200
    

With NAT66 active, LAN clients retain full IPv6 functionality, Happy Eyeballs resolves connections immediately without fallback delays, and all packets exit through the VPN's external IPv6 node.


Verifying the Kill-Switch

At 365Finds, we do not consider an IPv6 leak mitigated until it fails a direct socket inspection. Browser-based leak testing tools can cache previous lookups or mask failures behind WebRTC proxies.

To inspect your raw routing behavior from a client device connected to the router LAN:

# Verify what address the outside world observes over IPv4
curl -4 https://ifconfig.co

# Verify what address the outside world observes over IPv6
curl -6 https://ifconfig.co

If the IPv4 query returns your VPN endpoint and the IPv6 query either returns your VPN provider's exit node or cleanly errors out with Network is unreachable or Connection timed out, your leak path is closed. If the IPv6 command returns an address matching your ISP's allocated prefix, your gateway is actively leaking your geographical position.

References