What port forwarding does
Your router blocks unsolicited incoming connections by default, which is good for security. Port forwarding creates an exception: traffic arriving at your public IP on a chosen port, such as 25565 for a Minecraft server, is passed to a specific private IP inside your network.
Ports are like apartment numbers on a building address. The public IP gets traffic to your router, and the port number tells the router which service and device should receive it.
Outgoing connections such as browsing, streaming and most online gaming do not need port forwarding at all.
When you need it
Common reasons include hosting a game server, running a home web or media server, reaching network storage or security cameras from outside, and improving NAT type for some games and consoles.
Many modern apps avoid the need with UPnP, which lets devices open ports automatically, or with cloud relays. UPnP is convenient but lets any device on the network open ports, so many people prefer to disable it and forward ports manually.
Port forwarding only works if you have your own public IPv4 address. Behind carrier-grade NAT, the forwarded port never receives traffic.
How to set up port forwarding
The menu names vary by router, but the steps are the same. Give the target device a fixed private address first, otherwise the rule breaks when its address changes.
After saving the rule, test from outside your network, for example from a phone on mobile data. Testing from inside the same network often fails because many routers do not support hairpin connections.
- Reserve a fixed private IP for the device in the router DHCP settings.
- Find Port forwarding, Virtual server or NAT rules in the router.
- Enter the external port, internal port, protocol (TCP, UDP or both) and the device IP.
- Save, then allow the port in the device firewall.
- Test from outside your network using your public IP.
Service: Game server
External port: 25565
Internal IP: 192.168.1.50
Internal port: 25565
Protocol: TCPSecurity risks and safer alternatives
Any forwarded port is visible to internet-wide scanners within hours. If the service behind it has a weak password or an unpatched vulnerability, attackers can take over the device. Never forward remote desktop, router admin pages or camera web interfaces directly.
Forward only the ports you need, keep the software updated, use strong unique passwords and remove rules you no longer use. Safer alternatives include a VPN server on the router, mesh VPN services and cloud tunnels, which give you remote access without exposing a port to everyone.
If you use IPv6, devices may be reachable directly. Check the router IPv6 firewall to make sure only intended services are allowed in.
Why port forwarding is not working
The most common causes are carrier-grade NAT, a double NAT setup with two routers, the device firewall blocking the port, the wrong internal IP after the device got a new address, or a provider that blocks certain ports such as 25 or 80.
Compare the WAN address on your router with the public IP on an IP lookup page; if they differ, you are behind another NAT layer and need to ask your provider for a public IP or use a tunnel instead.
Also confirm that the service is actually running and listening on the port on the device itself.