Flamingo Raises $4.5M Seed Round

Skip to content

What is port forwarding? How it works, and when to skip it

Best Practices
Security
Technology
September 29, 2026
354 views
What is port forwarding? How it works, and when to skip it

What port forwarding does, how a router sends outside traffic to one device, the ports behind remote access requests, why exposed remote services like RDP were the top way into business networks in Sophos's 2025 report, UPnP, safer remote access options, and how to audit what is open today.


Updated: November 2026

Someone needs to reach a device on the office network from outside, and the fastest answer on every forum is "just forward the port." It works, and it also leaves a door open that the whole internet can knock on. Here's what port forwarding does, where it causes trouble, and what to use instead when the device belongs to a business.

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 network. Without the rule, the router drops that traffic, because it doesn't know which internal device it's meant for.

Think of the router as a building's front desk. The building has one street address, your public IP. Inside are the offices, your laptops, printers and servers, each with a private address the street never sees. A port number is like an apartment number on the envelope. Port forwarding is the note at the front desk that says "anything for apartment 8443 goes straight up to the server in room 50."

How port forwarding works

Take one worked example. The office has the public address 203.0.113.10, and a web app runs on a server at 192.168.1.50, port 443. The router gets a rule: traffic to 203.0.113.10 on port 8443 goes to 192.168.1.50 on port 443.

Someone outside types the public address and port. The router sees the request, checks its forwarding table, rewrites the destination to the internal server, and passes it through. Replies go back the same way. The person outside never learns the internal address.

The rule exists because of network address translation (NAT). NAT lets every private device share one public address for outbound traffic, which is why your laptop can browse the web without its own public IP. Inbound traffic is the problem NAT can't solve on its own. When a connection starts from outside, the router needs a rule to know where to send it, and a port forward is that rule.

The four parts of a rule

Each forwarding rule names an outside port, an internal IP address, an internal port and a protocol. 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. Our guide to TCP vs UDP covers how to tell which one a service uses.

On a firewall, the forward pairs with an allow rule for the same port, and pfSense creates that rule by default. A stateful firewall then tracks each connection, so replies go back out without a rule of their own.

Where to set up port forwarding

The rule lives in the router or firewall's admin page. Consumer routers file it under names such as Port Forwarding, Virtual Server or NAT, and other firewalls call it destination NAT or inbound NAT. On pfSense it sits under Firewall > NAT, on the Port Forward tab.

One setup defeats every rule you write. If the WAN address on your router falls in 100.64.0.0/10, or differs from the address a what-is-my-IP site reports, something upstream is translating again, which is carrier-grade NAT when the ISP does it. Inbound connections then never reach your router, and the fix is a matching forward on the upstream device or a public IPv4 address from the ISP, which can be a paid add-on.

What people use it for

At home, port forwarding lets people host game servers, reach a NAS or security camera from their phone, or run a small web app. In a business, the list looks similar with higher stakes: camera systems, file servers, a line-of-business app, and above all Remote Desktop on port 3389.

Vendors ask for them too. The camera installer, the phone system provider or the software company asks IT to "forward port X to this box" so their support team can connect. The request is reasonable. The way it gets done is where the risk lives.

Ports behind common requests

These are the default ports behind the remote access requests IT sees, taken from Microsoft's documentation, the IANA port registry and each project's own examples.

ServicePort and protocolUsed for
Remote Desktop (RDP)TCP and UDP 3389Remote control of a Windows machine
SSHTCP 22Command-line access to servers and network gear
VNCTCP 5900Screen sharing with a VNC server
HTTPSTCP 443Web apps, RD Gateway and SSL VPN portals
RD GatewayUDP 3391The UDP transport for RD Gateway sessions
OpenVPNUDP 1194 by defaultVPN connections
WireGuardUDP 51820 in its examplesVPN connections
IPsecUDP 500 and 4500Site-to-site and client VPNs

The first three put a login prompt for one machine on the internet. The VPN ports put a VPN endpoint there instead, which still needs patches and multi-factor authentication, because Sophos counts VPNs among the external remote services attackers exploit. Our guide to IPsec explains what each of its ports carries.

Is port forwarding safe?

A forwarded port is open to every address on the internet, including ones you never meant to let in. Automated scanners sweep the whole internet around the clock, so an open port gets found whether or not anyone announces it. Whatever service sits behind it then has to survive every password guess and every exploit thrown at it.

The numbers show where that goes. In Sophos's 2025 Active Adversary Report, based on more than 400 incident cases from 2024, attackers got in by exploiting external remote services with valid accounts in 56% of cases. Remote Desktop was involved in 84% of all cases.

There's good news in the 2026 edition, which covers 661 cases. External use of RDP showed up in 10% of cases, and Sophos saw exposed RDP systems roughly halve compared with the year before. Every forwarded RDP port you close takes one more machine off that list.

This r/msp story shows how fast it goes wrong. A client insisted on having 3389 forwarded to their PC instead of using a VPN, and the next morning the machine was encrypted.

So the short answer depends on what's behind the port. A game server at home is a small risk. A Windows server, a NAS or a camera system with a default password on a business network is an invitation, and our guide to ransomware attacks shows what can follow.

UPnP and the port forwarding nobody approved

A port can get opened without anyone touching the router. Universal Plug and Play (UPnP) lets devices on the network ask the router to create forwarding rules for themselves. Game consoles use it, and so do cameras, printers and smart TVs that support it.

That's convenient at home and a blind spot at work. A device can open an inbound path, and nobody gets a ticket about it. On a business router, switch UPnP off and create any rule you need by hand, so every open port has a person who asked for it.

Safer ways to give remote access

The goal is the same in each case: get the right person to the right device without leaving it reachable by everyone else. Here are the common options, from most exposed to least.

A port forward with an IP allowlist narrows who can connect, but it only works when the remote person has a fixed address. A VPN with multi-factor authentication puts a login in front of the whole network, so nothing behind it is visible until someone proves who they are, and our guide to a Windows VPN server covers the option built into Windows Server. Identity-aware access, sold as zero trust network access (ZTNA), goes further and grants access to one app at a time instead of the whole network.

The strongest pattern has nothing listening at all. Outbound tunnel connectors and agent-based remote access tools make the connection from inside the network out to a broker, so there's no inbound port to find. Our guide to remote access software compares the agent-based tools.

Teams that want to self-host can look at MeshCentral, an open-source option that runs on your own server.

SpaceRex walks through what port forwarding exposes and what to check before you open anything, with examples from NAS setups.

Port forwarding for remote desktop

Forwarding 3389 straight to a Windows machine is the setup behind the r/msp story above. Moving Remote Desktop to another outside port only changes the number that scanners find, and Microsoft's RDP troubleshooting guide says it doesn't recommend running Remote Desktop on another port.

If staff need Remote Desktop from outside, put RD Gateway in front of it, so sessions arrive over HTTPS on TCP 443 with UDP 3391 as the faster transport, or require a VPN with multi-factor authentication first.

Inside the network, keep Network Level Authentication on, so a user signs in before a session starts. Our guide to Network Level Authentication covers that setting and how to check your RDP exposure.

This r/ITManagers thread asks exactly this: staff need Remote Desktop to an office server from their own machines, with no ports opened. The replies cover RD Gateway, a VPN on managed devices, Microsoft's Global Secure Access, Tailscale and Apache Guacamole.

How to check what's open right now

Start with the router or firewall. Export the port forwarding table and the UPnP mapping list, if the device keeps one. Every line is a door, so every line needs an owner.

Then look from the outside, the way an attacker would. Run a port scan against your public IP from a machine outside the network, or look the address up in a search engine for internet-exposed devices such as Shodan. Anything answering that you didn't expect goes to the top of the list.

Keep a short register for every rule that survives:

RuleWho asked for itWhyReview date
443 to the web app serverOperations leadCustomer portalEvery quarter
3389 to the accounts PCNobody remembersUnknownClose it today

The second row is the one to hunt for. A "temporary" rule with no owner is the first one to question, because nobody can say whether its reason still exists. Our post on RMM security covers the same discipline for the tools techs use to reach machines every day.

Close the doors you don't need

Port forwarding is a useful tool with a simple rule attached: every open port is reachable by everyone. Keep the ones with an owner and a reason, replace the rest with a VPN, identity-aware access or an outbound connector, and switch UPnP off on business routers.

If a port you find has already been used against you, our guide to incident management covers what to do in the first hours.

Kristina Shkriabina

Content Marketing Lead

Ohayo! I run content, SEO, social, and community at Flamingo. Before IT, I worked as a correspondent for Ukraine's Public Broadcasting Company and have a Master's in journalism.

Related Content

Frequently Asked Questions

/blog/what-is-port-forwarding

Still deciding?

Ask Mingo answers from our docs and customer stories.

Loading related content and questions