ServerHosting.wiki

Operator notes

Port forwarding for game servers: the practical version

Port forwarding is conceptually trivial and operationally annoying. Most "how to port forward" guides skip the parts that actually break: NAT loopback, CGNAT, IPv6, and what to do when your router's UI lies to you. Here is the operator's version.

Published · ~6 min read

What you are actually doing

Your home router sits between the public internet and your local network. By default it lets your devices reach out (player → game server on the internet) but blocks anything coming in (other players → your home server). Port forwarding tells the router: "when traffic arrives on port X from the internet, send it to this specific machine on my LAN." That is the whole concept.

What ports to forward, by game

Common defaults. Always verify against the game's current docs because patches change them.

GamePort(s)Protocol
Minecraft Java25565TCP
Minecraft Bedrock19132 (IPv4), 19133 (IPv6)UDP
Valheim2456-2458UDP
Palworld8211UDP
7 Days to Die26900-26902 (game), 8081 (web)both
Project Zomboid16261-16262UDP
Vintage Story42420TCP/UDP
Conan Exiles Enhanced7777, 7778, 27015UDP
ARK Survival Ascended7777, 7778, 27015UDP
Rust28015 (game), 28016 (RCON)UDP / TCP
V Rising9876-9877UDP
Soulmask8777, 27015UDP
Counter-Strike 227015 (game), 27020 (SourceTV)both

Forward the ports above to the LAN IP of the machine running the server. That is usually a 192.168.x.x or 10.x.x.x address.

How to actually do it

Every router brand calls this menu something different. Common paths:

For each rule you typically specify: external port, internal port (usually the same), internal IP (your server's LAN address), and protocol (TCP, UDP, or both).

Critical tip: set a static DHCP reservation for your server's LAN IP first. Routers reassign DHCP leases periodically. The day yours rotates, your port forward suddenly points at the family laptop instead of your game server. Set the reservation in the router's DHCP settings before you set up the forward.

NAT loopback (why your friends can connect but you cannot)

Common scenario: you set up port forwarding correctly. Friends can join. You cannot, because connecting to your own public IP from inside the LAN does not loop back to the internal server on most routers.

Fixes, in order of preference:

  1. Connect to the LAN IP from inside the network. Use 192.168.x.x:port instead of your public IP from your own machine.
  2. Enable NAT loopback (sometimes called "NAT reflection" or "hairpin NAT") in your router. Many newer routers support it; older ISP routers do not.
  3. Add a hosts-file entry on your machine so your.dyndns.example.com resolves to the LAN IP locally.

Dynamic DNS for non-static IPs

Most home internet has a dynamic public IP that rotates every few days or when the router reboots. Telling players to update the IP every time is impractical.

Solutions:

The CGNAT trap

If your router's "WAN IP" starts with 100.64-100.127, you are behind Carrier-Grade NAT (CGNAT). Your ISP is sharing one public IP across many subscribers. Port forwarding does nothing because your router is not the edge; the ISP's CGNAT is. Common with mobile internet, some rural fiber, and entry-tier service plans.

Options when you are behind CGNAT:

  1. Ask your ISP for a public IPv4. Often free on request, sometimes a small monthly fee. Best long-term solution.
  2. Use a tunneling service. Tailscale, ZeroTier, Cloudflare Tunnel, or a VPS with a small reverse-proxy setup. Tailscale is the simplest for game servers because it works peer-to-peer without your players going through a third-party relay.
  3. Move to managed hosting. If neither of the above is feasible, the wall is permanent for self-hosting from this connection.

IPv6 (the side door that mostly works)

If your ISP gives you an IPv6 prefix, your server already has a public IPv6 address with no NAT. Players who also have IPv6 can connect directly without any forwarding. Older games (UDP-only with no IPv6 support in their netcode) cannot use this; newer games (Minecraft Bedrock, modern Unity titles) often can.

Worth checking if your router exposes the server's IPv6 address. Sometimes the path of least resistance.

Verifying it works

Before posting the connection details to your friends, test from outside your LAN. Three quick options:

If the port check fails, the typical culprits in order: software firewall on the server (Windows Defender, ufw on Linux), router firewall above the port-forward rule, ISP-side blocking, or you are behind CGNAT and did not realise.

Related