Networking and developer tooling notes
Concepts
5 min read

IPv4 vs IPv6 on Dual-Stack Networks: Why They Behave Differently

On a dual-stack network your device has both an IPv4 and an IPv6 address and picks one per connection. The two stacks differ in addressing, NAT, routing and firewalls, so test them separately with curl -4 and curl -6.

Editorial team

On a dual-stack network your device has both an IPv4 and an IPv6 address, and every new connection quietly picks one of them. The two stacks have different addresses, NAT behavior, routing paths and firewall rules, so one website can see two different IPs from you, load differently, or fail on only one stack. The quickest way to find out what is happening is to test each stack alone with curl -4 and curl -6. This article reflects the state of things as of November 2026.

What does dual-stack actually mean?

Dual-stack means a network interface runs IPv4 and IPv6 side by side. When you open a hostname, DNS can return both A records (IPv4) and AAAA records (IPv6), and your device chooses between them. By default the operating system's address-selection rules, defined in RFC 6724, prefer IPv6 when a usable global IPv6 address exists, so IPv6 is often used without anyone noticing.

Most modern applications go one step further with Happy Eyeballs (RFC 8305). They start an IPv6 attempt, wait a short delay (the RFC suggests 250 ms), and start an IPv4 attempt in parallel if IPv6 has not connected yet. The first one to succeed wins. This hides a broken stack from users, but it also means the URL never tells you which stack carried the traffic.

Why do IPv4 and IPv6 behave differently?

They are two separate networks that share a host. Addressing, NAT, routing and filtering are configured independently, so the same destination can be reachable by two different paths with different properties. The table lists the differences that matter most in practice.

AspectIPv4IPv6
Address32 bits, such as 192.0.2.10128 bits, such as 2001:db8::10
Typical home or mobile setupPrivate address behind NAT, sometimes carrier-grade NATGlobal address per device, no NAT by default
Address stabilityDHCP lease, often shared public addressISP-delegated prefix; devices rotate temporary addresses (RFC 4941)
Inbound filteringNAT acts as an implicit filterNeeds an explicit firewall on the router
FragmentationRouters may fragment packetsOnly the sender fragments; relies on ICMPv6 Packet Too Big; minimum MTU 1280
RoutingOwn BGP tables and peeringSeparate tables, so the path to the same host can differ

Two consequences are worth remembering. First, many services treat an entire IPv6 /64 as one subscriber, so the unit of identity is larger than a single address. Second, because privacy extensions rotate temporary addresses, the IPv6 address a site logged yesterday may not be the one you have today.

What problems does this cause in practice?

Most dual-stack trouble falls into a few patterns. In each case one stack works as intended while the other takes a different path, and tests on the working stack hide the problem.

  • Two different IPs. A VPN or proxy that only handles IPv4 leaves IPv6 connections on the native network, so a site can log your real IPv6 address next to the tunnel's IPv4 address. See how to check what IP and location a website sees.
  • DNS on the wrong stack. The router may hand out an IPv6 DNS server that your tunnel does not cover, a case covered in DNS leaks explained.
  • Black-holed large packets. If a firewall drops ICMPv6 Packet Too Big messages, path MTU discovery (RFC 8201) fails: small pages load, large downloads stall.
  • Broken AAAA records. A site that publishes an IPv6 address it does not serve properly causes timeouts that Happy Eyeballs only partly hides.
  • IPv6-only mobile networks. Carriers that run NAT64 and DNS64 reach IPv4-only destinations through translation, which can break software that uses literal IPv4 addresses.
  • Proxy path differences. With a proxy, the stack used on the last leg is chosen by whoever resolves the hostname. A client that resolves locally and sends an IPv6 literal to a proxy that cannot reach IPv6 will fail.

How do I check which stack a connection uses?

Query each stack on its own and compare the results. If only one stack answers, or the two answers show different addresses or locations, you have found the difference to investigate. These commands run on Linux, macOS and Windows with curl installed.

curl -4 https://ifconfig.me/ip
curl -6 https://ifconfig.me/ip
dig +short A example.com
dig +short AAAA example.com

The first two print the public address each stack presents; an error from curl -6 means that stack has no usable route. The dig lines show whether the hostname even has AAAA records. For a single request, curl -v https://example.com prints a "Trying" line with the address family it picked.

To see your local addresses, use ip -6 addr show scope global on Linux, ifconfig en0 on macOS (look for inet6 lines), or ipconfig on Windows, which labels rotating addresses as temporary IPv6 addresses. For path comparisons, traceroute -4 and traceroute -6 on Linux, or tracert -4 and tracert -6 on Windows, trace each stack separately. A browser-based dual-stack test such as test-ipv6.com is also handy for a quick overview. Compare these results with your VPN off and on, because the tunnel may carry only one family.

How do I force or avoid one stack while troubleshooting?

For single commands, -4 and -6 are enough. For the whole machine, prefer changing the preference order over disabling IPv6, because some applications and networks expect IPv6 to exist. Disabling is a quick diagnostic step, not a permanent fix.

# Linux: prefer IPv4 when both exist (add to /etc/gai.conf)
precedence ::ffff:0:0/96  100

# Linux: disable IPv6 temporarily (set back to 0 to restore)
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1

# macOS: disable and restore on the Wi-Fi service
networksetup -setv6off Wi-Fi
networksetup -setv6automatic Wi-Fi

# Windows PowerShell (administrator)
Disable-NetAdapterBinding -Name "Wi-Fi" -ComponentID ms_tcpip6
Enable-NetAdapterBinding -Name "Wi-Fi" -ComponentID ms_tcpip6

After each change, re-run the curl -4 and curl -6 checks so you know which state you are testing. If the problem disappears when one stack is off, you have located the layer; the fix is then to make the tunnel or proxy cover that stack, or to correct the broken AAAA record or ICMPv6 filter.

Where AnboVPN fits

AnboVPN's official clients support TUN mode, which takes over device traffic through a virtual adapter, and the same account offers Shared IP, Dedicated IP, HTTP/SOCKS5 proxy and Network gateway connections. This article makes no claim about IPv6 support for any particular connection type. Run the curl -4 and curl -6 checks against your own setup, with the client on and off, and compare the addresses and locations you see. For the background on what TUN mode captures, read TUN mode vs system proxy. Clients are on the download page.

References

IPv4
IPv6
Dual-stack
Happy Eyeballs
Troubleshooting

FAQ

Should I disable IPv6 to avoid leaks?
Only as a diagnostic step or a deliberate local policy. Disabling IPv6 does stop connections from taking the native IPv6 path, but some applications and networks expect it, including IPv6-only mobile networks. A cleaner approach is to check whether your VPN or proxy carries IPv6, change address preference where needed, and verify with curl -4 and curl -6.
Why does a website show an IPv6 address I do not recognize?
Most operating systems use temporary IPv6 addresses (RFC 4941) for outgoing connections and rotate them, so the address a site logs differs from the stable one shown in your network settings. It also sits inside a prefix your ISP delegated to your router, so it may not match any IPv4 address you know.
Is IPv6 faster or slower than IPv4?
It depends on the route, not the protocol version. IPv4 and IPv6 use separate routing tables and sometimes different peering, so the same destination can be quicker over either one. Measure both on your own network with curl -4 and curl -6 or a traceroute for each family, instead of assuming either is better.
Does a proxy hide my IPv6 address?
Only for the traffic you send through the proxy. Applications that do not use it still connect over your native IPv4 and IPv6 addresses. For proxied connections, the address the destination sees is the proxy's address on whichever stack it uses to reach the site, which is why a separate check for each stack is worth doing.

Related posts

Getting Started

How Much VPN Data Do You Need? A Practical Way to Estimate It

Measure what your devices actually transfer in a normal week, convert video bitrate with GB per hour = Mbps x 0.45, then add a margin of 15 to 20 percent. Only traffic routed through the VPN counts, so routing choices matter as much as habits.

Data plan
Traffic estimate
Bitrate
Troubleshooting

Why Does My VPN Keep Disconnecting? A Troubleshooting Checklist

VPN drops almost always trace back to a short list: the network underneath changing or going idle, a NAT or firewall closing the flow, an MTU mismatch, power saving, conflicting software, or an exhausted account. Test them in that order.

VPN troubleshooting
NAT timeout
MTU
Troubleshooting

How to Read traceroute and mtr Reports: Loss, Latency, Hops

traceroute and mtr list the routers between you and a destination using packets with increasing TTL. Trust only loss that continues to the last hop and latency jumps that stay high from one hop onward. Loss on a single middle hop is usually ICMP rate limiting.

traceroute
mtr
Packet loss
Concepts

Split Tunneling and Smart Routing: Send Only Some Traffic via VPN

Split tunneling sends only selected traffic, by app, address or domain, through the VPN or proxy and lets the rest use your normal connection. It keeps local devices and bulk downloads off the tunnel, but you must verify what each side really does.

Split tunneling
Smart routing
Routing table