
WireGuard needs at least one side that can be found. With both home and phone inside the carrier's network, nobody can knock first.
Many home lines installed since 2020 share an address. The router says the port forward worked, but there is another router above it at the provider that you cannot reach.
Make sure
If the router's WAN address differs from a what-is-my-IP page, or starts between 100.64 and 100.127, there is no public IPv4.

Four ways
- Ask the carrierSome hand out a public IPv4 on request
- Use IPv6If both sides have it, open the UDP port and connect directly
- Relay through a VPSBoth connect to the VPS, which passes it on
- Hole punchingTailscale, ZeroTier or NetBird find a path for you
The VPS relay
Home and phone are both peers of the VPS. What matters is AllowedIPs on the VPS:
[Peer]
# home
PublicKey = HOME_PUBLIC_KEY
AllowedIPs = 10.8.0.2/32, 192.168.1.0/24
[Peer]
# phone
PublicKey = PHONE_PUBLIC_KEY
AllowedIPs = 10.8.0.3/32Add PersistentKeepalive = 25 at home to hold the door open and turn on forwarding on the VPS. The phone uses 10.8.0.0/24, 192.168.1.0/24.

What each costs
| Way | Speed | Money |
|---|---|---|
| IPv6 direct | Your home upload | 0 |
| VPS relay | The slowest of the VPS and both lines | A few dollars a month |
| Hole punching | Direct if it works, relayed if not | Mostly free tiers |
Three minutes to find out
- Read the WAN IPv4 address in the router.
- Open any "what is my IP" page on the same network.
- Equal means public; different means not.
| WAN address starts with | Meaning |
|---|---|
10., 172.16 to 172.31, 192.168. | Another router above |
100.64. to 100.127. | Provider's shared address |
| Anything else, equal to the page | Public |
If the modem dials and the router only gets 192.168.1.x, look in the modem or have it set to bridge mode.
Direct over IPv6
Many providers and most mobile networks have IPv6. Test on the phone with Wi-Fi off, and at home; both need it.
- Turn on IPv6 in the routerDevices get an address starting with 2 or 3
- Open the firewallUDP 51820 to that machine
- Dynamic DNSAn AAAA record
- A fixed suffixNo temporary address
An address in Endpoint needs brackets: [2001:db8::1]:51820. The name is resolved only once, when the tunnel starts: if the home address changes, switch the tunnel off and on. Networks with only IPv4, such as some offices and hotels, cannot use it; many people keep a VPS as the second way.
Relay through a VPS
Turn on forwarding:
echo 'net.ipv4.ip_forward=1' | sudo tee /etc/sysctl.d/99-wg.conf
sudo sysctl --system[Interface]
Address = 10.8.0.2/32
PrivateKey = home-private-key
[Peer]
PublicKey = vps-public-key
Endpoint = vps-address:51820
AllowedIPs = 10.8.0.0/24
PersistentKeepalive = 25To reach other devices at home, such as a NAS at 192.168.1.10, turn on forwarding there too and rewrite addresses, so that the NAS knows how to answer:
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADEWhat limits the speed
Home upload first, often a tenth of the download; then the VPS's bandwidth; then the distance, twice. Fine for managing and documents, not for 4K.
Why hole punching sometimes fails
Both NATs have to cooperate. If both use a different port per destination, only a relay is left; mobile networks are often like that. Try Tailscale first: a few tailscale ping tell whether direct works.
Is direct IPv6 unsafe?
Open only WireGuard's UDP port. It does not answer anyone without a key.
My IPv6 changes.
Use dynamic DNS as with IPv4, updating the address of the WireGuard machine, not the router.
How do I ask for a public IP?
Say you have cameras at home and need access from outside. Some give it, some change the plan, some refuse.
Are all devices exposed with IPv6?
The router's IPv6 firewall blocks incoming by default; you open one port. Do not turn it off.
Can the VPS read my traffic?
Yes, the two tunnels meet there. If that matters, build another tunnel inside, or use an end-to-end tool.


