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.
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.
Related 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