WireGuard, VPN or Server Behind CGNAT: Why It Fails and How to Fix It

Your VPN or home server works on your LAN but not from outside? Usually CGNAT: your ISP shares one public IP, so port forwarding does nothing. How to confirm it, and the fixes that work.

By Eric GerardFounder · VPNSmith - Self-host VPN & GDPR VPS specialist

Updated 8 min read8 min

Affiliate links: we may earn a commission, at no extra cost to you. Method

See the installation stepsGenerate my config

Inbound connection to a home server blocked by CGNAT, then an outbound WireGuard tunnel to a VPS relay that clients reach instead1 INBOUND: BLOCKEDCLIENTCGNATHOMEno public IP, port forward fails2 OUTBOUND TUNNEL: WORKSHOMEVPSCLIENTUDP 51820 out, keepalive 25
fig. 01 / self-host-vpn

You installed WireGuard on your home server, opened UDP 51820, forwarded the port on your router - and it still will not connect from outside. Before you re-check the config for the tenth time, suspect the network: the most common reason a self-hosted VPN cannot be reached from the internet is CGNAT, and no amount of router configuration fixes it. Here is what it is, how to confirm it, and the fixes that actually work.

Inbound connection to a home server blocked by CGNAT, then an outbound WireGuard tunnel to a VPS relay that clients reach instead1 INBOUND: BLOCKEDCLIENTCGNATHOMEno public IP, port forward fails2 OUTBOUND TUNNEL: WORKSHOMEVPSCLIENTUDP 51820 out, keepalive 25
fig. 01 / self-host-vpn

Short version: if your ISP puts you behind CGNAT, the fix that always works is to host WireGuard on a server that has its own public IPv4. A HostPapa Unmanaged VPS Lite (affiliate link, 2.95 $ a month on a 3-year term, then the regular rate) or a Contabo Cloud VPS (affiliate link) includes one, from 5.50 € a month on a 24-month term as read on 17 October 2026, and your home network only needs an outbound tunnel to it. If you would rather have a US host with a 30-day money-back guarantee, Ultahost VPS Basic is 5.52 $ a month on a 24-month term (1 GB RAM, dedicated IPv4, read on 21 October 2026), enough for a WireGuard server for a few devices. Choosing a host? Compare the best VPS for a VPN and Contabo vs Hetzner vs OVH on the price actually billed. HostPapa's Lite plan is the smallest one here: 1 core, 1 GB RAM, 25 GB NVMe and 4 TB transfer, unmanaged (root SSH on Ubuntu or Debian, no control panel, you install WireGuard yourself), enough for a WireGuard server for a few devices, 30-day money-back guarantee, read on 28 October 2026.

What is CGNAT, and why does it break self-hosting?

CGNAT (carrier-grade NAT) is how many ISPs cope with the shortage of IPv4 addresses: instead of giving each customer their own public IP, they put many customers behind one shared public address. Your router's WAN side gets a private-range address (often in 100.64.0.0/10), and the ISP's own NAT decides what comes in.

The consequence is simple and frustrating: there is no public IP that points to your line, so inbound connections have nowhere to land. Port forwarding on your router only controls traffic that already reached your router - and with CGNAT it never does, because the block is one level upstream, inside the ISP.

How do you check if you are behind CGNAT?

You can confirm it in a minute. Open your router's admin page and find its WAN IP address. Then look up your public IP at a service like whatismyip. If the two do not match, something upstream translates your address before it reaches the internet. A router WAN IP inside 100.64.0.0/10 is the clear sign of carrier-grade NAT. A private range such as 10.x.x.x or 192.168.x.x more often means a second router of your own first (an ISP modem in router mode, for example): put that box in bridge mode, or forward the port on it too, and check again. If the WAN IP is still private after that, the translation happens at the ISP.

Our free WireGuard port checker does this comparison in your browser: type the WAN address from your router, click once to detect your public IP, and it tells you whether a port forward can work at all, with the next step for each case.

A home ISP router and modem beside a television - the device that sits behind carrier-grade NAT, where inbound port forwarding often fails.
A home ISP router and modem beside a television - the device that sits behind carrier-grade NAT, where inbound port forwarding often fails.

How do you run WireGuard behind CGNAT?

  • A VPS with a public IP (most reliable). Host WireGuard on a cheap VPS. It has a real public IPv4, so there is no NAT to fight - your devices connect straight to it. A Contabo Cloud VPS comes with its own public IPv4 (affiliate link). If you also need to reach your home LAN, run a small tunnel from home out to the VPS; that connection is outbound, which CGNAT allows.

  • A NAT-traversal mesh (easiest). Tailscale, the self-hosted Headscale, or Netbird use outbound connections and relay servers to link two devices behind NAT, with zero port forwarding. See what Tailscale is and how it works.

  • Ask your ISP for a public IP. Some providers will move you off CGNAT or sell a static IP, sometimes for a small fee.

  • IPv6. If your ISP hands out real routable IPv6, WireGuard over IPv6 avoids the shared-IPv4 problem - provided both ends have working IPv6.

  • Reverse tunnels. Cloudflare Tunnel, wstunnel or an SSH reverse tunnel initiate outbound from home to a public endpoint, so they too work through CGNAT.

  • A VPN with port forwarding (no server to run). If you only need to expose one service (a game server, Plex, seeding), Proton VPN opens an inbound port on its own public IP while your device stays behind CGNAT (affiliate link). Per Proton's support page, read on 25 October 2026: paid plans only, P2P servers only, and the server picks a random port that usually changes when you reconnect, so it suits a single app you can update, not a fixed WireGuard endpoint.

    Paid plan, Black Friday 2026: Proton's partner offer, checked on 28 October 2026, is 70% off VPN Plus on the 2-year plan (shown to us at $2.99/month, $71.76 for the first 24 months, then $83.88 per year), with a 30-day money-back guarantee. The order page shows the price for your country, and Proton does not publish an end date.

Whichever route you pick, you will still want a stable name to reach it; our dynamic DNS guide covers keeping a hostname pointed at a changing address.

Our paid WireGuard Self-Hosting Kit (9 USD) ships the two halves of this reverse tunnel as commented templates: cgnat-vps.conf for the VPS with the public IP and cgnat-home.conf for the box behind CGNAT that dials out, plus the nftables.conf and sysctl files the VPS needs to forward traffic.

Why is a VPS usually the best fix for CGNAT?

For a VPN you rely on, a VPS with its own public IP removes the whole problem class. You get a predictable address, full control of the firewall and port, no dependence on your ISP's goodwill, and it doubles as an exit node if you want one. The honest trade-off is a few dollars a month and the small responsibility of keeping the server updated.

Once the VPS is up, our free WireGuard config generator writes the server config and the client configs for it in your browser, keys included. The generator is free with no account, up to 250 devices, and its ZIP export holds every client .conf and its QR code as a PNG, handy to set up a whole office or family in one go.

Generate your WireGuard configs here

Type your server address, choose the number of devices, then scan each QR code from the app.

All keys are generated in your browser (Curve25519 / X25519). Nothing is sent to our servers - your config stays 100% private.

Public IPv4 or domain of the machine that will run WireGuard. No server yet? Leave it empty and add it later.

Free, no account: up to 250 clients, each .conf with its QR code, and one ZIP with every file.

Everything the device sends to the internet goes through your server.

Advanced settingsTunnel subnet, DNS, site-to-site LANs. The defaults work for most setups.

Optional. Enter the LAN subnet behind the server and/or behind a client that acts as a site gateway (a router, a Raspberry Pi, a NAS). The generator adds each LAN to the server's AllowedIPs, gives every peer the routes to the other LANs, and writes the forwarding rules on the gateways. Leave a field empty for a normal client.

What you download

  • wg0.conf

    for the server

  • client1.conf

    one per device

  • QR (sample)

    for the phone app

Illustration only: the lines and the QR code are fictional, no real key. Your real files are generated in your browser when you click.

Fibre patch cables plugged into a network switch in a data centre - a VPS gives you a public IP there, bypassing home CGNAT entirely.
Fibre patch cables plugged into a network switch in a data centre - a VPS gives you a public IP there, bypassing home CGNAT entirely.

The bottom line

If WireGuard connects fine on your local network but never from outside, suspect CGNAT before your config. Confirm it with the WAN-versus-public-IP check, then choose a fix: a public-IP VPS is the most reliable, a NAT-traversal mesh is the simplest zero-forwarding option, and IPv6 or an ISP public IP work well where they are available. The problem is your ISP's address sharing, not your WireGuard file.

Escaping CGNAT means renting a machine with a real public IPv4. Our cheapest-VPS comparison shows which providers include one and at what price.

Keep the decision at hand: our free Home Server Remote Access Cheat Sheet (4-page PDF, direct download, no sign-up) shows how to tell CGNAT, double NAT and a dynamic IP apart, which method fits each case, and the commands for DDNS, a WireGuard relay on a VPS, Cloudflare Tunnel or Pangolin, and wstunnel. Download the cheat sheet.

A VPN changes your IP. It does not change your browser.

A tunnel replaces the address a service sees. It changes nothing about what your browser announces on its own - fonts, screen, time zone, graphics stack - and that combination is often stable enough to recognise you across sessions, tunnel or no tunnel.

Measure your own browser fingerprint - passive, no questions, no account, no email.

Affiliate link

Price checked 17 Oct 2026, 24-month term

Frequently asked questions

How do I know if I'm behind CGNAT?
Compare two addresses. Log into your router and note its WAN IP; then check your public IP at a site like whatismyip. If they are different - or your router's WAN IP falls in 100.64.0.0/10 (the reserved CGNAT range), or a private range like 10.x or 192.168.x - you are behind carrier-grade NAT. Mobile, 4G/5G home internet and some fibre plans use it most. A traceroute that shows an extra ISP hop before the internet is another sign.
Can I port-forward WireGuard behind CGNAT?
No. Forwarding UDP 51820 on your own router does nothing, because the blocking NAT is upstream at your ISP, not on your router. You do not have a real public IP to forward to. The fixes all work around this: host WireGuard on a public-IP VPS, use a NAT-traversal mesh (Tailscale, Headscale, Netbird), use IPv6 if your ISP provides it, or ask your ISP for a non-CGNAT public IP.
Does a VPS fix WireGuard behind CGNAT?
Yes, and it is usually the most reliable fix. A VPS has a real, routable public IPv4, so there is no NAT to fight. You either host WireGuard directly on the VPS, or run a small outbound tunnel from your home server to the VPS - outbound connections work fine through CGNAT, so your home box stays reachable via the VPS. You control the firewall and the port, and it does not depend on your ISP.
Will Tailscale or Headscale work behind CGNAT?
Usually yes. NAT-traversal meshes like Tailscale, its self-hosted control plane Headscale, and Netbird are built for exactly this: they make outbound connections and use relay servers (DERP) to connect two devices that are both behind NAT, with no port forwarding at all. They are the easiest zero-configuration option when plain WireGuard cannot get an inbound port.
Is IPv6 a fix for CGNAT?
It can be. Many CGNAT setups still hand out real, routable IPv6, and WireGuard runs happily over IPv6 - which sidesteps the shared-IPv4 bottleneck entirely. The catch is that IPv6 must actually work end to end: your server needs a stable IPv6 address and firewall rule, and the client's network must support IPv6 too. Where that holds, it is a clean, free fix; where it does not, fall back to a VPS or a mesh.