You set up a WireGuard server, a game server or a NAS at home - and from outside, nothing connects. The missing piece is almost always port forwarding: the router setting that opens a deliberate doorway to a service on your network. This guide explains what port forwarding is, how to set it up, the security risks to respect, and the CGNAT wall that stops it - with the alternative when it does.
What port forwarding is
By default, your router uses NAT to share one public IP across all your devices, and it blocks unsolicited inbound connections - so nothing on the internet can reach a service running at home. That's good for security, but it also means your self-hosted server is unreachable.
Port forwarding creates a controlled exception: a rule that says "traffic arriving on external port X goes to this device's local IP and port." Send WireGuard's UDP port to your server's 192.168.1.50, and suddenly your tunnel is reachable from anywhere.
How to set it up
- Give the device a static local IP (reserve it in your router's DHCP) so the rule doesn't break later.
- Open your router's admin page (often
192.168.1.1), find Port Forwarding (a.k.a. "Virtual Server" or "NAT"). - Add a rule: external port, protocol (WireGuard = UDP), and the device's internal IP and port.
- Save and test from outside - use mobile data, not your own Wi-Fi (many routers don't loop back internally).
For the WireGuard server itself, see self-hosting a VPN on Contabo with WireGuard, and pair port forwarding with dynamic DNS so a changing home IP doesn't break access. The port you forward for WireGuard is UDP 51820 by default: see what port WireGuard uses and how to open it.
TCP, UDP, and using a different external port
Two details trip people up after the rule looks correct:
- Pick the right protocol. Forward UDP for WireGuard, TCP for a website or SSH, or both if a service needs both. Forwarding TCP when the service is UDP is one of the most common "rule is there but nothing connects" mistakes.
- The external and internal port don't have to match. You can forward external 41194 → internal 51820, so the outside world talks to an unusual port while your server keeps its normal one. This cuts noise from bots scanning the default port; just set each client's
Endpointto the external port. It's light hardening, not true stealth.
A quick port reference: WireGuard's default UDP 51820, OpenVPN UDP 1194, HTTPS TCP 443, SSH TCP 22. Avoid forwarding 22 or admin ports straight to the internet unless you've locked them down.
The security side
Every forwarded port is an open door to one service - so the risk is exposing something weak:
- Forward the minimum - ideally one well-secured entry point.
- Keep that service updated and authenticated (no default passwords, no exposed admin panels).
- Prefer a properly configured VPN (WireGuard) as your single forwarded port, then reach everything else through the tunnel, rather than forwarding many services directly.
Never forward a port to a service you haven't hardened.
UPnP and port triggering: the automatic options
Manual rules aren't the only way to open a port:
- UPnP lets apps request a port-forward automatically (game consoles and torrent clients rely on it). Convenient, but it means any device on your LAN can open ports without asking - a real security trade-off. Leave it on for casual gaming, turn it off and forward manually for anything you care about.
- Port triggering opens an inbound port only after a device sends outbound traffic on a trigger port, then closes it again. It's more dynamic than a static rule and useful for apps with changing ports, but it doesn't suit an always-on service like a VPN, which needs the port open permanently.
For a self-hosted VPN, a single manual UDP rule to a static-IP server is the right call - predictable and auditable, unlike UPnP.
The CGNAT wall - and the fix
The most common reason port forwarding "doesn't work" isn't a misconfigured rule - it's CGNAT. Many ISPs (especially mobile and some fibre) put you behind Carrier-Grade NAT, where you share a public IP with other customers and have no real public IP of your own. No router rule can forward a port you don't control.
Check: if your router's reported WAN IP doesn't match what a "what's my IP" site shows, you're behind CGNAT. The fixes: ask your ISP for a public IP, use an overlay network (Tailscale/NetBird) that needs no inbound port, or run your service on a cheap VPS with a permanent public IP. A Contabo VPS at €5.50/month gives you a real public IP and a clean WireGuard entry point with no port-forwarding or CGNAT headaches - compare hosts in our best self-hosted VPN guide.
The bottom line
Port forwarding opens a deliberate doorway through your router's NAT so the internet can reach a service at home - essential for a self-hosted WireGuard server, and best paired with a static local IP and dynamic DNS. Forward only what you've secured, prefer a single VPN entry point, and if CGNAT blocks you, a cheap VPS with a permanent public IP is the clean way around it.
Editorial guide based on how NAT, port forwarding and CGNAT work on home networks. Results depend on your ISP and router. Commercial links carry the rel="sponsored nofollow" attribute; an affiliate commission may apply at no extra cost to you.
★ Nuremberg GDPR datacenter · ✓ Dedicated IPv4 included · 200+ Mbps guaranteed
Self-host your VPN on your own VPS → ContaboFull root access · public IPv4 · pick your region→

