What is port forwarding? How to let friends join the server on your home PC
What is port forwarding? How to let friends join the server on your home PC
Last updated 2026-08-12
Short answer
Port forwarding tells your router to pass incoming internet connections to the machine running your server — Minecraft uses port 25565, for example. But many Thai home connections sit behind CGNAT, which makes forwarding impossible no matter what you configure; you either request a public IP from your ISP or run the server on a host instead.
Contents
Contents
You set up a game server on your own PC and can join it just fine, but your friend can't connect. Almost every time the problem isn't the game — it's the router, which by default never passes connections from the internet to any machine inside your home. This article explains why, walks through port forwarding step by step, and is honest about the cases where nothing you configure will ever work.
Why friends can't join a server inside your home
Your home has exactly one public IP (a real address on the internet) — the router's. Every device inside uses internal addresses (usually starting with 192.168.x.x). This arrangement is called NAT: outbound connections like browsing work because the router remembers which machine asked and routes each reply back to it.
But when a friend types your home IP, that is an inbound connection with no history behind it. The router has no idea which machine should receive it, so it simply drops it — and your friend sees connection timed out even though the server is genuinely running.
Port forwarding is a rule that tells the router: "anything arriving on this port always goes to this machine" — for example, port 25565 (Minecraft Java) goes to the PC running the server.
Step 1 — Pin the server machine's internal IP
The forwarding rule points at your machine's internal IP. If that IP changes (routers reassign them all the time), the rule silently breaks. Pin it first:
Press Win + R, type cmd, then run ipconfig — write down the IPv4 Address (for example 192.168.1.35) and the Default Gateway (that's your router's IP, used in the next step).
Recommended way: open your router's settings, find the DHCP Reservation menu (some brands call it Address Reservation or Static Lease), and bind this IP to your machine permanently.
If your router has no such menu, set a static IP on the Windows side instead: Settings → Network & internet → pick your adapter → set IP assignment to Manual with the same IP, the Subnet Mask that ipconfig shows (for most homes 255.255.255.0), and the router's IP as Gateway.
Step 2 — Open your router's admin page
Open a browser and type the router's IP (the Default Gateway you noted — usually 192.168.1.1 or 192.168.0.1). The admin username and password are typically on a sticker under the router; if not, your ISP's call center can tell you.
The menu you're looking for goes by different names per brand: Port Forwarding, Virtual Server, Port Mapping, NAT Forwarding, or Application — all the same thing.
Step 3 — Add the forwarding rule
Create a new rule and fill in:
External/WAN port — the game's port, e.g. 25565
Internal/LAN IP — the server machine's IP from step 1
Internal port — same number as the external port
Protocol — per the table below (Minecraft Java uses TCP, most other games UDP). If unsure, Both/TCP+UDP is fine.
Then don't forget the firewall on the Windows side: Windows Defender Firewall → Advanced settings → Inbound Rules → New Rule → Port → enter the same port → Allow the connection. Skip this and the router delivers the connection to your machine — which then rejects it itself.
Step 4 — Test from outside your network
Find your home's public IP by searching "what is my IP", then check it with an online port checker (search for exactly that — several free ones exist). If the result says open, forwarding works: give friends the address as IP:port, for example 171.100.x.x:25565.
One caution: don't test over your own home Wi-Fi. Many routers can't loop a connection back into their own network (NAT loopback), which produces the classic "works for me, not for my friend" confusion — or the reverse. Test from a phone on 4G/5G with Wi-Fi off and you'll see exactly what your friends see.
Default ports per game
Game
Default port
Protocol
Minecraft Java
25565
TCP
Minecraft Bedrock
19132
UDP
Palworld
8211
UDP
Valheim
2456–2457
UDP
Enshrouded
15636–15637
UDP
7 Days to Die
26900–26902
UDP for the whole range + TCP on 26900
Factorio
34197
UDP
Core Keeper
No forwarding needed
Friends join via Game ID over Steam's relay
These ports can be changed in each game's config file; the table shows the defaults each game ships with.
Everything is configured correctly and it still fails — check CGNAT
Many Thai home connections don't actually give you a real public IP. Instead, many households share one IP through an extra NAT layer at the ISP, called CGNAT (Carrier-Grade NAT). Behind CGNAT, forwarding on your own router changes nothing: inbound connections are dropped at the ISP's NAT and never even reach your router.
How to check: open your router's page and look at the WAN IP or Internet IP.
In the range 100.64.x.x through 100.127.x.x = CGNAT for certain (that range is reserved specifically for CGNAT).
WAN IP doesn't match your "what is my IP" search result = behind ISP NAT as well.
There is really only one fix: call your ISP and request a public IP (some provide it free on request, some charge a monthly fee). Otherwise the server has to move to a machine that already has a real IP — a rented VPS, or a game hosting service.
The limits that remain even when forwarding works
Your home IP keeps changing — home connections use dynamic IPs that change when the router reboots or the ISP rotates them, for some homes nearly every day. You'll be re-sending the new IP to friends, or setting up DDNS (DuckDNS, No-IP) for a domain name that tracks the IP automatically. (DDNS solves the changing IP; it does nothing for CGNAT.)
The PC must stay on — friends can join only while your machine is running, electricity bill and nighttime fan noise included.
Upload speed is the bottleneck — your home connection's upload bandwidth caps how many players it can serve.
An open port is a real door — port-scanning bots will drop by periodically; that's normal internet weather. Open only the ports the game uses, keep the server updated, and enable the whitelist if the game supports it.
If you'd rather not fight all of this
Everything above is the work of hosting from home — genuinely doable, and free, as long as your connection isn't behind CGNAT. The alternative is a game host that has already handled the networking: on uniz.host, every server gets its own domain address from the moment it's created — no forwarding, no CGNAT, no PC left running — and billing is hourly, only while the server is online (see pricing).
I opened the port but my friend still can't join — why?
Check in order: 1) Does the server machine have a static internal IP yet? 2) Is Windows Firewall blocking the port? 3) Is your home connection behind CGNAT? (A WAN IP on your router starting with 100.64–100.127 means CGNAT.)
What is CGNAT, and can I fix it?
Your ISP shares one public IP across many households, which makes forwarding ports yourself impossible — the fixes are calling your ISP to request a real public IP (some charge a fee) or moving the server to a host that already has one.
Is opening a port dangerous?
An open port is a real door into your machine — open only the ports the game uses, keep the server software updated, and turn on the whitelist if the game supports it.