Copied!
Sign In
Access your IPWhois.net account
No account? Create one
Home / FAQ / What Is Port Forwarding?

What Is Port Forwarding?

Learn how port forwarding works, common port numbers, step-by-step router setup instructions, security considerations, and alternatives like UPnP.

What Is Port Forwarding?

Port forwarding (also known as port mapping) is a technique that directs incoming network traffic from a specific port on your router's public IP address to a specific device and port on your local network. It is a form of Destination NAT (DNAT) that allows external devices to access services running behind your router's firewall.

Because of NAT, devices on the internet cannot directly reach devices on your private network. Port forwarding creates a rule that tells the router: "When traffic arrives on port X, send it to internal device Y on port Z."

Example: You run a Minecraft server on your PC at 192.168.1.50. Your friend wants to connect from outside your network. You set up a port forwarding rule: external port 25565 → internal 192.168.1.50:25565. Your friend connects using your public IP and the game works.

Common Port Numbers

Ports range from 0 to 65535. Here are the most commonly forwarded ports:

PortProtocolServiceUse Case
80TCPHTTPWeb server
443TCPHTTPSSecure web server
22TCPSSHRemote terminal access
21TCPFTPFile transfer
3389TCPRDPWindows Remote Desktop
25565TCPMinecraftMinecraft server
27015TCP/UDPSteam/SourceGame servers (CS2, TF2, etc.)
8080TCPHTTP AlternateDevelopment web servers, proxies
25TCPSMTPEmail sending
53TCP/UDPDNSDNS server
1194UDPOpenVPNVPN server
51820UDPWireGuardVPN server
32400TCPPlexMedia server

Port ranges: 0–1023 are "well-known" ports (system services), 1024–49151 are "registered" ports, and 49152–65535 are "dynamic/ephemeral" ports used for temporary connections.

How to Set Up Port Forwarding

The general steps to configure port forwarding on most routers:

  1. Assign a static IP to your device: The target device should have a fixed local IP so the forwarding rule always points to the right place. Either set a static IP on the device or create a DHCP reservation on the router.
  2. Log into your router: Open http://192.168.1.1 (or your gateway IP) and enter admin credentials.
  3. Find the port forwarding section: Usually under "Advanced," "NAT," "Firewall," or "Virtual Servers" depending on the router brand.
  4. Create a new rule:
    • Service name: A label for the rule (e.g., "Minecraft Server")
    • External port: The port number external users will connect to
    • Internal IP: The local IP of your device (e.g., 192.168.1.50)
    • Internal port: The port the service is listening on (often the same as external)
    • Protocol: TCP, UDP, or both
  5. Save and apply: The rule takes effect immediately on most routers.
  6. Test: Use our Port Checker tool to verify the port is open and reachable from the internet.
Tip: If port forwarding is not working, check these common issues: the device's local firewall may be blocking the port, the service may not be running, you may be behind Carrier-Grade NAT (CGN), or there may be a double NAT situation.

Security Risks

Port forwarding exposes internal services to the internet, which introduces security risks:

  • Attack surface: Any open port is a potential entry point. Attackers scan for open ports (especially common ones like 22, 3389, 80) and attempt exploits.
  • Brute force attacks: SSH (22) and RDP (3389) are frequent targets for password guessing attacks.
  • Unpatched services: If the software behind the port has vulnerabilities, attackers can exploit them to gain access to your network.
  • DDoS: An open port can be targeted with denial-of-service attacks.

Mitigation strategies:

  • Use non-standard port numbers (e.g., run SSH on port 2222 instead of 22) to reduce automated scans.
  • Use strong, unique passwords and enable multi-factor authentication where possible.
  • Keep software updated with the latest security patches.
  • Consider using a VPN instead of port forwarding for remote access - this eliminates the need to expose services directly.
  • Use fail2ban or similar tools to block IPs after failed login attempts.

Alternatives: UPnP and NAT-PMP

UPnP (Universal Plug and Play) and NAT-PMP (NAT Port Mapping Protocol) allow applications to automatically create port forwarding rules on your router without manual configuration.

  • How it works: When an application (like a game or torrent client) needs an open port, it sends a request to the router via UPnP, and the router automatically creates a temporary forwarding rule.
  • Convenience: No manual router configuration needed - applications handle it automatically.
  • Security concern: UPnP is often considered a security risk because any application (including malware) on your network can open ports without your knowledge. Many security professionals recommend disabling UPnP and configuring port forwarding manually.

Other alternatives include reverse tunnels (e.g., Cloudflare Tunnel, ngrok) that expose services without any port forwarding, and IPv6, where every device has a public address and port forwarding becomes unnecessary (firewall rules are used instead).

Quick Check: After setting up port forwarding, use our Port Checker tool to verify that the port is open and accessible from the internet. If it shows as closed, double-check your router rule, the device's firewall, and whether your ISP uses Carrier-Grade NAT.
Port Checker
Use our free online tool - no signup required