How to Port Forward for a Game Server (and Why You Might Not Need To)
friends can't connectport forwarding not workingCGNATPort forwarding tells your home router to send incoming game traffic to the right PC. Here's how to do it, the ports to open, and why it sometimes can't work at all.
What port forwarding does
Your router shares one public IP across every device. When a friend connects to your game, the router needs to know which PC to hand that traffic to — a port-forward rule maps a port to your PC's local IP.
Step 1: give your PC a static local IP
Forwarding breaks if your PC's local IP changes. Set a DHCP reservation in the router, or a static IP on the PC (e.g. 192.168.1.50).
Step 2: forward the game's port
In your router (usually at 192.168.1.1) → Port Forwarding, add a rule pointing the game port to your PC's local IP. Common ports:
Minecraft (Java) 25565 TCP
CS2 / Source 27015 UDP+TCP
Rust 28015 UDP
Valheim 2456-2457 UDP
FiveM 30120 TCP+UDP
Step 3: allow it in your firewall
Windows Firewall must allow the same port inbound, or the router forwards traffic to a PC that drops it. Add an inbound rule for the port/protocol.
Step 4: test from outside
Have a friend connect using your public IP (not 192.168.x.x), or use our server status checker from outside your network.
Many ISPs (especially mobile/fibre) put you behind Carrier-Grade NAT, so you don't have a real public IP — and no amount of port forwarding will work. If your router's WAN IP differs from your public IP, you're on CGNAT.
The simpler answer: host it elsewhere
A hosted game server has a real public IP, the ports open by default, no router config, no exposing your home IP, and DDoS protection. For anything beyond a quick LAN-style session with friends, it's the easier and safer route.
Port forwarding works until CGNAT, a dynamic IP or your home upload ruins it. A hosted server skips all three.
Port forwarding not working? Check these first
- Double NAT — a modem sitting in front of your router can need forwarding on both devices, or bridge mode enabled on the modem.
- UPnP conflicts — if UPnP already opened a different mapping for that port, a manual rule can silently be ignored; disable UPnP for that port and set the rule manually instead.
- Wrong protocol — many games need both TCP and UDP, or a full port range, not a single port.
- ISP-level port blocking — some ISPs block certain ports (like 25) outright regardless of your own router settings.
How to prevent port forwarding problems
- Set the DHCP reservation before forwarding, so the rule never goes stale after a router reboot changes your PC's local IP.
- Keep a note of every port rule you've added, so you can debug or remove one later without guessing.
- Re-test with a server status checker after every router firmware update — updates sometimes silently reset forwarding rules.
Related networking guides
If forwarding looks correct but players still can't join, see "Connection timed out" joining a game server. To find the exact address to share once it works, read how to find your server's IP and port. If the connection is up but choppy, see what causes packet loss.
Skip port forwarding entirely
A hosted game server has a real public IP, open ports and DDoS protection out of the box — online in minutes.
Frequently asked questions
Why isn't my port forwarding working?
Common reasons: your PC's local IP changed, the firewall is blocking the port, you forwarded the wrong protocol (TCP vs UDP), or your ISP uses CGNAT so you have no real public IP. Test from outside your network to be sure.
What is CGNAT and how do I know if I have it?
Carrier-Grade NAT means your ISP shares one public IP across many customers, so you can't accept inbound connections. If the WAN IP in your router doesn't match the public IP shown by an "what's my IP" site, you're behind CGNAT.
Is it safe to port forward a game server from home?
It works, but it exposes your home IP (a DDoS risk) and opens a port into your network. For a public or persistent server, a hosted one with a separate protected IP is safer.
Do I need to forward both TCP and UDP?
It depends on the game — check its specific port requirements. Many games only need UDP for gameplay but TCP for the master-server/browser listing, so forwarding just one often leaves the server half-working.
Why did port forwarding stop working after a router restart?
A router reboot can reassign your PC a new local IP if you didn't set a DHCP reservation, which breaks the existing forward rule since it still points at the old IP. Set a reservation so this can't happen.
Is UPnP a safe alternative to manual port forwarding?
UPnP is convenient — games and apps can open ports automatically — but it's less predictable and is sometimes disabled for security reasons on routers or by ISPs. Manual forwarding is more reliable for a dedicated server you want to keep stable.
How do I check if a forwarded port is actually reachable from outside?
Use an online open-port checker, or our server status checker, from a network other than your own. Testing from a device on your home Wi-Fi can give a false "it works" result even when outside traffic can't get in.
Go deeper on this
Guides and explainers that pair with this fix — from our guides and blog.
What Is Ping, and How Do You Lower It?
What causes high ping and the practical ways to reduce it.
ReadWhat Is a DDoS Attack?
How DDoS works, the main types, and what actually stops it.
ReadProtect Your Game Server From DDoS
What real protection looks like, and what you can do yourself.
ReadGame Server Lag: CPU or Network?
How to tell which one is hurting you, and how to fix each.
ReadRelated articles
Fix "Connection Timed Out" When Joining a Game Server
"Connection timed out" joining a server? How to tell whose side it is — and fix it.
Read fix NetworkingWhat Causes Packet Loss in Games (and How to Fix It)
Rubber-banding and warping is packet loss, not lag. What causes it, how to test, and how to fix it.
Read fix NetworkingHow to Find Your Game Server's IP and Port
Where to find your server's IP and port to share with friends — hosted or at home.
Read fix