Port forwarding is a router rule that sends traffic arriving at your public address on one port to one device inside your private network. Without it, your router drops inbound traffic because it does not know which device it is for. It is used for game servers, remote desktop, cameras and home servers, but every forwarded port is an open door that scanners can find, so prefer a VPN or remote-access service where possible.
Key takeaways
- Port forwarding maps one external port to one internal device and port, so outside traffic can reach a service behind NAT.
- Every forwarded port is visible to internet-wide scanners, and exposed Remote Desktop on port 3389 is a leading ransomware entry point.
- Use a VPN, a remote-access service or a tunnel instead where you can, and audit your open ports regularly.
You want to reach your home computer from the office, host a game server for friends, or check a security camera from your phone. Your router blocks all of that by default — and port forwarding is the rule that lets one specific kind of traffic through.
What is port forwarding?
Port forwarding is a router rule that sends traffic arriving at your public internet address on one port to a specific device and port inside your private network. Without the rule, the router drops that traffic, because it does not know which internal device it is meant for.
It exists because of network address translation, or NAT. NAT lets every device in your home share one public IP address for outbound traffic, which is why your laptop can browse the web without its own public address. Inbound traffic is the problem NAT cannot solve on its own: when a packet arrives from outside, the router has no way to know which of your devices should receive it.
Port forwarding solves that by writing the answer down in advance. A rule names an outside port, an internal IP address, an internal port and a protocol (TCP, UDP or both). When a packet matches, the router rewrites its destination and passes it through. Replies go back the same way, and the person outside never learns your internal address.
How does port forwarding work?
Port forwarding works in four steps: an outside request arrives at your public address, the router checks its forwarding table, it rewrites the destination to the internal device, and the device replies through the router. The whole exchange takes milliseconds.
A concrete example: you want to reach your home computer from the office. You create a rule that sends port 8080 to your computer's internal address, say 192.168.1.10. From outside, you connect to your public address followed by :8080, and the router forwards the request to that computer.
Each rule is specific. Get the protocol wrong and the rule never matches, so UDP traffic from a game or a VPN client gets dropped at a TCP-only forward. Give the device a static internal address, or a DHCP reservation, so its address does not change and break the rule overnight.
What is port forwarding used for?
Port forwarding is used whenever a service inside your network needs to be reachable from outside: game servers, remote desktop, security cameras, home servers and small web apps are the most common cases at home, with similar uses in small offices.
- Game servers. Hosting a multiplayer session or a dedicated server, where other players need to connect directly to your machine.
- Remote desktop. Reaching a home or office computer from elsewhere, usually over Remote Desktop on port 3389 — a use case with serious risks, covered below.
- Security cameras and NAS. Viewing a camera feed or reaching files on a network drive from your phone while you are away.
- Home servers. Running a small web app, a media server or a smart-home hub that needs inbound access.
- Business apps. Camera systems, file servers and line-of-business apps that staff or customers need to reach remotely.
The request behind each of these is reasonable. The way it gets done is where the risk lives: a forwarded port is open to everyone on the internet, not just to the person you had in mind.
What are the types of port forwarding?
There are three main types: local, remote and dynamic forwarding. Router port forwarding, the subject of this article, is remote forwarding — but the other two appear often enough that the terms get confused.
| Type | What it does | Typical use |
|---|---|---|
| Remote (router) | Outside traffic reaches a device inside your network | Game server, camera, home server |
| Local | Your device reaches a remote service through a local port | Accessing a service behind a firewall |
| Dynamic | Creates a tunnel or proxy for many ports at once | Secure browsing over SSH or a VPN |
| UPnP | Devices open ports automatically, no manual rule | Consoles and apps that need inbound access |
| Port triggering | Opens a port only after outbound traffic triggers it | Gaming, with tighter control than UPnP |
UPnP deserves a warning of its own. It lets devices open ports on the router automatically, which is convenient for consoles and apps — but malware can use the same mechanism to open ports for itself. Many security guides recommend turning UPnP off and creating manual rules only for services you actually need.
Port triggering is a middle ground: the port opens only after your device sends outbound traffic that triggers it, and it closes again afterwards. It is more secure than a permanently open forward, but not every router or application supports it well.
Is port forwarding safe?
Port forwarding is not safe by default. A forwarded port is open to every address on the internet, including ones you never meant to let in, and automated scanners sweep the whole internet around the clock, so an open port gets found whether or not anyone knows about your setup.
The risks are concrete. An exposed service can be brute-forced, exploited through an unpatched vulnerability, or used as a foothold for malware and ransomware. CISA lists exposed Remote Desktop Protocol on port 3389 as a weakness commonly used in ransomware campaigns, and advises using MFA and closing unused RDP ports. Its internet-exposure guidance urges organizations to remove unnecessary exposures and secure the ones that remain.
The more ports you open, the larger your attack surface. Each open port is another entry point, and a forwarded port bypasses the firewall protection your router otherwise provides. A forwarded camera with a default password, or a remote desktop service with a weak one, can be found and entered within hours of being exposed.
Which ports do people forward most often?
The ports people forward most often are the ones tied to familiar services: 80 and 443 for web traffic, 3389 for Remote Desktop, 22 for SSH, and game-specific ports. Knowing the numbers helps you recognize a risky rule when you see one.
| Port | Service | Risk if exposed |
|---|---|---|
| 80 / 443 | HTTP / HTTPS web traffic | Medium — patch the web server, use HTTPS |
| 3389 | Remote Desktop (RDP) | High — leading ransomware entry point |
| 22 | SSH | High if password login is allowed; use keys |
| 21 | FTP | High — unencrypted; use SFTP instead |
| 5900 | VNC remote desktop | High — often weak authentication |
| 25565 | Minecraft server | Low to medium — keep the server patched |
Port numbers themselves are assigned by IANA, but any service can run on any port, so a scanner does not trust the number — it probes the service behind it. Changing RDP to a non-standard port does not make it safe; it only makes it slightly harder to find.
How do you set up port forwarding safely?
You set up port forwarding in your router's admin page, and you set it up safely by forwarding only what you need, to a patched device, with strong authentication — then checking that it actually works and nothing extra is open.
- Give the device a static address. Set a DHCP reservation or a static IP, so the rule does not break when the address changes.
- Open the router admin page. This is usually at 192.168.1.1 or 192.168.0.1. Find the port forwarding or virtual server section.
- Create one rule per service. Enter the external port, the internal IP and port, and the correct protocol (TCP, UDP or both).
- Use a non-standard external port where you can. It is not security on its own, but it reduces noise from casual scans.
- Secure the service. Strong, unique passwords, MFA where available, and the latest patches on the device and the service.
- Test from outside. Check the service works from a phone on mobile data, then scan your public address to confirm only the intended port is open.
- Turn off UPnP. Unless a device genuinely needs it, disable automatic port opening so nothing else can open ports without you knowing.
If your router's WAN address falls in 100.64.0.0/10, or differs from the address a what is my IP tool shows, you are behind carrier-grade NAT and inbound traffic never reaches your router. The fix is a public IPv4 address from your ISP, which can be a paid add-on, or a tunnel-based alternative instead.
What are the safer alternatives to port forwarding?
The safer alternatives are a VPN, a remote-access service, or a tunnel such as Cloudflare Tunnel or Tailscale. Each one lets you reach your devices without opening a port to the whole internet.
| Option | Open ports? | Best for | Downside |
|---|---|---|---|
| Port forwarding | Yes, one per service | Game servers, public services | Exposed to scanners |
| VPN | VPN port only, with MFA | Remote access to a whole network | Needs setup and patching |
| Remote-access service | No | Remote desktop for individuals | Subscription cost, trust in vendor |
| Tunnel (e.g. Cloudflare Tunnel) | No | Publishing a home service safely | More setup than a simple forward |
For a game server that strangers need to reach, port forwarding may still be the right tool — there is no authenticated user to put behind a VPN. For remote access to your own devices, it almost never is. CISA's internet-exposure guidance is direct: route necessary remote access through a secure gateway, firewall, VPN or other centrally managed solution, rather than connecting directly to the device.
Our guide to how to secure your Wi-Fi covers the router settings that go with this, including changing default passwords and keeping firmware updated.
How do you audit the ports you already have open?
You audit open ports by listing your router's forwarding and UPnP rules, then scanning your public address from outside your network. Anything you do not recognize, or no longer need, should be closed.
- Check the router. Log in and list every port forwarding rule and every UPnP mapping. Delete rules for services you no longer run.
- Scan from outside. Use a port scanner against your public IP address from a connection outside your network, such as a phone on mobile data.
- Check the device firewall. A forwarded port is only useful if the device behind it accepts the traffic — and only safe if that device is patched and password-protected.
- Review after changes. Repeat the check after any router reset, firmware update or ISP change, because defaults can re-enable UPnP.
- Log and monitor. If your router logs connection attempts, review them. A sudden rise in probes on one port is a sign to close it or move the service behind a VPN.
For a business, this audit belongs in a wider attack-surface review: every internet-facing service, not just the ones you remember forwarding. That is what our attack surface management platform is built to track continuously.
The bottom line
Port forwarding is a useful, simple tool — and a risky one. It lets the internet reach exactly one service inside your network, but it also lets the internet find that service, probe it and attack it. Use it for services that genuinely need to be public, and nothing else.
For remote access to your own devices, use a VPN with MFA or a remote-access service instead, keep every exposed service patched, and audit your open ports regularly. You can start by checking what your connection reveals with the free what is my IP tool.
Frequently asked questions
What is port forwarding in simple terms?
Port forwarding is a rule on your router that says traffic arriving on a certain port should go to a specific device inside your home or office network. Without the rule, the router drops that traffic because it does not know which device it is meant for.
Is port forwarding safe?
It can be safe for a well-patched service with strong authentication, but it is never risk-free. A forwarded port is open to the whole internet, and scanners find open ports quickly. Avoid forwarding remote desktop or admin services directly, and prefer a VPN instead.
What is port forwarding used for?
Common uses are hosting a game server, reaching a home server or NAS remotely, viewing security cameras, running a small web server, and remote desktop access. In businesses it is also used for camera systems and line-of-business apps.
What is the difference between port forwarding and UPnP?
Port forwarding is a manual rule you create on the router. UPnP lets devices open ports automatically without you doing anything. UPnP is more convenient but riskier, because malware can use it to open ports for itself.
Why is my port forwarding not working?
The most common causes are a wrong internal IP address, a device whose address changed, the wrong protocol (TCP instead of UDP), a firewall on the device blocking the port, or carrier-grade NAT from your ISP, which means inbound traffic never reaches your router at all.
What is carrier-grade NAT, and how does it affect port forwarding?
Carrier-grade NAT is when your ISP shares one public IP address between many customers. If your router's WAN address is in the 100.64.0.0/10 range or differs from what a what-is-my-IP site shows, you are behind it, and port forwarding on your router alone will not work.
Should I forward port 3389 for Remote Desktop?
No, not directly to the internet. CISA lists exposed Remote Desktop on port 3389 as a common ransomware entry point and advises blocking it at the perimeter. Use a VPN with MFA, or a remote-access service, instead.
How do I check which ports are open on my network?
Check your router's port forwarding and UPnP settings first, then scan your public IP address from outside your network with a port scanner. Close any port you do not recognize or no longer need, and repeat the check after any router change.
Sources
- Splashtop — What is Port Forwarding? How It Works, Risks & Alternatives
- Surfshark — What is VPN port forwarding?
- CISA — Internet Exposure Reduction Guidance
- CISA — Misconfigurations and Weaknesses Known to be Used in Ransomware Campaigns
- SlashGear — How Does Port Forwarding Work And What Are The Alternatives?
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against CISA internet-exposure and ransomware guidance, Splashtop's port forwarding guide and Surfshark's port forwarding explainer.
How we write and fact-check →