Blog

WireGuard IPv4/IPv6 Failover: Why Two Peers Are Not Enough

Learn why two WireGuard peers do not create IPv6-to-IPv4 endpoint failover, and how to inspect endpoint, routing and keepalive behavior safely.

FreeGuard Editorial Team · 2026-11-05

Adding an IPv4 peer and an IPv6 peer to a WireGuard profile does not, by itself, create a preferred connection and a standby connection. First separate the address used to reach the VPN server from the destination addresses carried inside the tunnel. That distinction explains why a configuration can look redundant while offering no automatic recovery.

This guide covers WireGuard configuration semantics and diagnostic commands for Linux systems with WireGuard tools. Mobile and desktop applications can add their own connection management; check the behavior of the exact client and version you use. No live network tests are claimed here.

Separate the endpoint from the traffic inside the tunnel

The WireGuard conceptual overview describes two decisions: select a peer for an inner destination, then send the encrypted packet to that peer’s endpoint. IPv4 and IPv6 can be combined across these layers.

Setting Question it answers
Endpoint Where should encrypted UDP packets be sent?
AllowedIPs Which inner destination addresses select this peer, and which incoming source addresses are accepted from it?

An IPv4 endpoint can carry IPv6 tunnel traffic. An IPv6 endpoint can carry IPv4 tunnel traffic. Therefore, AllowedIPs = ::/0 does not mean “use the server’s IPv6 address,” and AllowedIPs = 0.0.0.0/0 does not mean “use its IPv4 address.” Those entries match inner destination families, as documented in the wg manual.

Why two peers do not form a failover pair

Giving one peer all IPv4 destinations and another all IPv6 destinations divides the inner traffic by address family. It does not tell WireGuard to move the first peer’s traffic to the second when an endpoint stops working.

Giving both peers the same destination prefix is also not a standby policy. In the Linux WireGuard allowed-IP implementation, inserting an already present exact prefix updates its peer association. That is an implementation observation, not a cross-platform promise about which configuration a graphical client will accept. Do not use duplicate prefixes as a health check or priority list.

Route installation is another layer. On Linux, wg-quick normally derives routes from peer allowed IPs and handles default routes specially. Its Table option changes that behavior. A route reaching the WireGuard interface and a peer selecting the intended destination both need to be correct.

Roaming, hostname updates and keepalives solve different problems

WireGuard can update a peer’s endpoint after receiving correctly authenticated traffic from a new source address and port. This documented roaming behavior does not define an ordered list of IPv6 and IPv4 destinations to probe when the current endpoint is unreachable.

Likewise, a hostname with both address families is not sufficient evidence of automatic fallback. Inspect the endpoint actually in use and check the client’s documented resolution and reconnect policy. The project’s separate DNS re-resolution contribution updates kernel endpoint state after a dynamic DNS change; its existence is a useful reason to investigate the managing tool, not a reason to assume every client continuously re-resolves hostnames.

Persistent keepalives address idle NAT or firewall mappings. The official quick start gives 25 seconds as an interval suitable for many such setups and says most users do not need it. Keepalives do not specify an alternate endpoint or a route-switching policy. A connection that stalls after a mobile network change is not, by that symptom alone, proof of a carrier fault or a keepalive problem.

Inspect a Linux connection without exporting its configuration

Replace wg0 with your interface name. These are reference commands for your own machine; they were not executed against a reader’s VPN:

sudo wg show wg0 endpoints
sudo wg show wg0 allowed-ips
sudo wg show wg0 latest-handshakes
sudo wg show wg0 transfer

The wg manual documents these selective views. Keep their output local: endpoints and peer identifiers can still reveal your network. Avoid sharing complete configuration exports or secret-bearing dumps.

Record the state around an attempt to reach a known public service. An old handshake on an idle tunnel is not enough to diagnose failure. Compare endpoint, handshake and transfer observations with the application’s result.

Observation Next investigation
The endpoint family differs from the inner traffic family This can be valid; inspect destination selection separately
Traffic stays with one peer despite duplicate prefixes Review peer associations; duplication does not establish standby behavior
A network change leaves the endpoint unreachable Check the client’s endpoint-selection and reconnect policy
Tunnel traffic resumes but names still fail Investigate DNS separately using the Linux DNS workflow

Choose and verify a recovery policy

For one server reachable over both families, use a client or network manager whose documented behavior covers the endpoint selection and recovery you require. With plain profiles, a controlled comparison using one endpoint at a time can establish which path works, but manual switching is not automatic failover.

Save the original settings securely before changes. On a trusted connection, repeat the same harmless application request before and after an ordinary network transition. Keep VPN protection enabled. Do not force an outage on a remote connection you depend on for recovery.

If automatic recovery is the goal, look for a reachable endpoint, new handshake and traffic evidence, and a successful application request after the transition. Verify both inner address families when both are required. Record recovery time yourself rather than assuming a guarantee. Restore the saved settings if the change makes connectivity worse.

A browser IP check is evidence about that browser request. It cannot identify WireGuard’s selected endpoint, prove every application’s route, or establish that a future failover will work. The site’s DNS check also does not establish the device’s recursive resolver or prove VPN routing. Use runtime observations and application checks together.

For the broader question of which destinations should use a tunnel, continue with the split tunneling topic hub. Keep that routing decision separate from the policy that restores a failed server connection.