Port forwarding is safe when you forward only the exact port and protocol one hardened service needs, keep that service patched and behind strong authentication, restrict who can connect, and turn the rule off when you no longer need it. It is unsafe when it exposes services with weak passwords, default credentials or unpatched software — especially Remote Desktop on port 3389, which attackers scan for constantly.
Key takeaways
- Port forwarding is not inherently unsafe, but every open port is an address the whole internet can knock on — scanners find new open ports within hours.
- The safety of a forward depends on the service behind it: patched software, strong authentication and MFA matter far more than the router setting itself.
- Remote Desktop (3389), SMB (445) and Telnet (23) should never be forwarded directly; a VPN or a cloud relay is the safer way to reach them remotely.
Port forwarding is how you reach a device on your home or office network from the internet — a game server, a camera, a NAS, a web app. It works by telling your router to send traffic on one port straight to one device inside. The catch is that the same rule works for everyone, including attackers.
Is port forwarding safe?
Port forwarding is safe when the service behind the forwarded port is hardened, and risky when it is not. The rule itself is just a door; whether it is safe depends on what is standing behind it.
Microsoft's own guidance puts it the same way: opening a port is not inherently unsafe, but it exposes a service on your internal network to the internet and increases your attack surface. Microsoft's guidance on opening a router port says safety depends on what service is exposed, how well it is secured, and whether proper firewall and access controls are in place.
That framing matters, because most port forwarding failures are not router failures. They are services that were configured as if only local users would ever reach them — default passwords, no encryption, unpatched software — suddenly facing the whole internet.
How does port forwarding work?
Your router has one public IP address, shared by every device on your network. When traffic arrives from the internet, the router has to decide which device should receive it. By default it has no rule, so it drops the packet. That default is what protects you.
A port forward is a rule that changes that: send traffic arriving on public port X to internal device Y on port Z. Each rule names an outside port, an internal IP address, an internal port and a protocol (TCP or UDP). Get the protocol wrong and the rule never matches, so a game's UDP traffic gets dropped by a TCP-only forward.
Ports are 16-bit numbers, from 0 to 65535, assigned by IANA. Well-known services have standard ports: web traffic uses 80 for HTTP and 443 for HTTPS, SSH uses 22, Remote Desktop uses 3389. Attackers know these numbers, which is why they probe them first — you can look any of them up in IANA's port number registry.
Some routers also let apps open ports automatically through UPnP (Universal Plug and Play). If your router has UPnP on, inspect its active forwards even if you never configured one manually — a game console, a camera or malware may have opened ports without you knowing.
What are the risks of port forwarding?
The core risk is exposure. A forwarded port turns a service that was only reachable from your living room into a service reachable from anywhere on earth, and automated scanners will find it. In 2013, researchers showed that ZMap could survey the entire IPv4 address space in under 45 minutes from a single machine. Your address is in that space.
The specific risks depend on the service:
- Exploited vulnerabilities. Unpatched software behind a forwarded port can be attacked directly. Some flaws bypass the login screen entirely.
- Weak or default passwords. Attackers try default credentials first, then common passwords, at machine speed. Palo Alto Networks' Unit 42 team put 320 deliberately weak honeypot servers on the internet in 2021 and found attackers breached 80% of them within 24 hours — and 100% within a week.
- Credential stuffing and brute force. A login page on the internet gets hammered with password guesses around the clock. Without rate limiting or lockout, a weak password eventually falls.
- Lateral movement. Once an attacker is inside one device, they can probe the rest of your network from the inside, where your router's firewall no longer protects you.
- Silent UPnP rules. Malware on a device inside your network can use UPnP to open a port for itself, creating a way back in that you never approved.
The damage is not theoretical. Exposed Remote Desktop was the top initial access vector into business networks in Sophos's 2025 threat reporting, and exposed remote services remain one of the most common ways ransomware gets in.
Which ports are most dangerous to forward?
Not all ports carry the same risk. The danger depends on what the port's service lets an attacker do once they reach it.
| Port | Service | Risk if forwarded | Safer alternative |
|---|---|---|---|
| 3389 | Remote Desktop (RDP) | Very high — full control of a computer; the top ransomware entry point | VPN with MFA, or a cloud remote-access tool |
| 445 | SMB file sharing | Very high — file access and worm spread; never expose to the internet | VPN, or a cloud file service |
| 23 | Telnet | Very high — unencrypted login, credentials sent in plain text | SSH (port 22) with key authentication |
| 21 | FTP | High — unencrypted credentials and data | SFTP or a managed file transfer service |
| 22 | SSH | Medium — safe with key authentication and no password login | Keep it, but disable password login |
| 80 / 443 | Web server | Medium — depends on the app behind it; keep it patched | Reverse proxy with authentication |
| Game ports | Game servers | Low to medium — designed to face the internet | Forward only the game's exact ports |
The rule of thumb: never forward a port that gives full control of a machine (RDP, SSH with passwords) or direct file access (SMB, FTP) unless you have no other option — and if you have no other option, put a VPN in front of it instead.
How to forward ports safely: 8 rules
If you need port forwarding, these rules keep the risk as low as it can go. They are the same practices Microsoft recommends for opening a port on a router.
- Only open what you need. Forward the exact port and protocol the service requires — nothing extra, no ranges "just in case". Close rules the moment you stop using them.
- Patch the service and the router. Keep the app behind the port updated, and update the router firmware too. Many router vulnerabilities are fixed in firmware updates people never install.
- Use strong authentication. Long, unique passwords and MFA wherever the service supports it. Never expose a service that has no authentication, or one that still uses its default admin password.
- Restrict access by IP. If your router or firewall supports it, allow connections only from the IP addresses you actually connect from. This single setting blocks nearly all automated scanning.
- Turn off UPnP. Automatic port opening is convenient and dangerous. Disable it and create your rules by hand, so nothing opens a port without your knowledge.
- Use encryption. The service behind the port should use TLS or SSH. Never forward Telnet or plain FTP, which send credentials in readable text.
- Monitor logs and traffic. Check the router and service logs for repeated failed logins or unusual connections. A spike in failed logins is your early warning.
- Use a non-standard external port as a bonus, not a defense. Forwarding an unusual outside port to the standard inside port cuts down scan noise, but scanners can still find the service. It is a small extra layer, never a replacement for patching and authentication.
Safer alternatives to port forwarding
Often you do not need port forwarding at all. These options give you remote access without putting a service directly on the internet.
| Alternative | How it works | Best for | Downside |
|---|---|---|---|
| VPN | You connect to your home network over an encrypted tunnel, then reach devices as if you were local | Remote Desktop, NAS, cameras | Needs a VPN server and MFA setup |
| Cloud relay / tunnel | A service such as Cloudflare Tunnel or Tailscale brokers the connection; no inbound port is opened | Self-hosted web apps, home servers | Depends on a third-party service |
| Vendor cloud access | Many cameras and NAS devices offer the maker's own remote-access service | Cameras, NAS, smart home | Trust in the vendor's cloud security |
| Reverse proxy with login | One hardened gateway in front of your services, with authentication before anything loads | Multiple self-hosted web apps | More setup than a simple forward |
For most home users, a VPN or a tunnel service is the better answer. You get the same remote access, but the internet sees a single authenticated endpoint instead of every service you run. Our guide to securing your Wi-Fi covers the router settings that go with this, including firmware updates and guest networks.
How to check what is already open
Before changing anything, find out what is already exposed. Log in to your router's admin page and look under Port Forwarding, Virtual Server or NAT. Write down every rule, and delete any you do not recognize or no longer need.
Then check for UPnP rules on the same page and turn UPnP off. After that, scan your own public IP from outside your network — from a phone on mobile data, for example — to see which ports actually answer. You can find your public address with our what is my IP tool, then test the ports from an external scanner.
Repeat the audit every few months. Rules accumulate: a game you stopped playing, a camera you replaced, a test server you forgot. Every forgotten forward is a door you left open.
Is port forwarding safe for gaming and game servers?
For gaming, yes, in most cases. Game servers are built to accept connections from strangers, and forwarding only the exact ports the game needs is a normal, supported setup. Keep the server software updated, run it on a machine that does not hold sensitive files, and do not forward anything else alongside it.
The risk rises when a game server shares a machine with other services. If you forward a game port to a PC that also runs file sharing or Remote Desktop, an attacker who finds a flaw in the game server can reach the rest of the machine. Run game servers on a dedicated device or virtual machine where you can.
The bottom line
Port forwarding is a trade: convenience for exposure. It is safe when the trade is deliberate — one port, one hardened service, strong authentication, and a rule you remove when you are done. It is dangerous when it is casual: broad ranges, default passwords, unpatched software, and UPnP rules you never saw.
When in doubt, do not forward. A VPN or a tunnel gives you the same remote access with far less exposure, and your router's default — dropping everything it does not recognize — is the safest setting it has. Check your own exposure with our what is my IP tool and review the forwards on your router today.
Frequently asked questions
Is port forwarding safe for gaming?
Usually yes, for a specific game server port on a patched machine. Game servers are designed to face the internet, and forwarding only the port the game needs is a normal setup. Keep the server updated and do not forward extra ports such as RDP or file sharing alongside it.
Can port forwarding get you hacked?
Yes, if the service behind the forwarded port has a vulnerability or a weak password. Attackers scan the whole internet for open ports and try known exploits and common passwords automatically. A patched service with strong authentication is a much harder target.
Is port forwarding safe with a VPN?
Forwarding a port to a VPN server is safer than forwarding to most other services, because the VPN requires authentication and encryption before anything else is reachable. Even so, keep the VPN patched, require MFA, and forward only the VPN port.
What is the difference between port forwarding and UPnP?
Port forwarding is a manual rule you create on your router. UPnP lets devices and apps on your network create those rules automatically, without asking you. UPnP is riskier because malware or a compromised device can open ports silently, so most security guides recommend turning it off.
Does port forwarding slow down my internet?
No, not in any way you would notice. A port forward is just a routing rule; it does not add meaningful overhead. If your connection slows after forwarding, the cause is usually the service itself receiving traffic, not the rule.
Should I use a non-standard port for safety?
It reduces noise from automated scans, but it is not real security. Scanners can find services on any port, and a determined attacker will port-scan your whole address. Treat a non-standard port as a small bonus on top of patching and strong authentication, never as a replacement.
How do I check which ports are open on my router?
Check your router's admin page under Port Forwarding, Virtual Server or NAT, and turn off UPnP to see which rules apps created automatically. You can also scan your own public IP from outside your network with a port scanner, or use an internet-exposure search engine to see what is visible.
Is port forwarding illegal?
No. Port forwarding is a standard router feature and is legal. What matters is what you host behind it — hosting illegal content or running services that violate your ISP's terms can still get you in trouble.
Sources
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 Microsoft Learn guidance on opening router ports, the IANA port number registry, and published research on exposed services and honeypot compromise times.
How we write and fact-check →