Networking basics, Port Forwarding Basics

Port forwarding is a technique used to make services on a private network accessible from the outside. It works by configuring a router to forward external connection requests to specific devices and ports inside the local network. This guide explains how port forwarding works and when to use it.

Step 1: What is Port Forwarding?

Your router uses NAT (Network Address Translation) to hide internal devices behind a single public IP. By default, unsolicited external traffic is blocked. Port forwarding tells the router to allow specific traffic and forward it to a specific device and port.

Step 2: Why Use Port Forwarding?

  • Host a game server or website from your home
  • Access a security camera remotely
  • Enable remote desktop (e.g., RDP, SSH)
  • Run services like FTP, VPN, or VoIP

Step 3: How It Works

Incoming traffic: 
    203.0.113.5:8080 → Router → 192.168.1.10:80

The router takes the external request and forwards it to the internal server on the correct port.

Step 4: Common Ports

  • HTTP: 80
  • HTTPS: 443
  • FTP: 21
  • SSH: 22
  • RDP (Windows Remote Desktop): 3389

Step 5: Setting Up Port Forwarding

  1. Login to your router’s admin panel (often 192.168.1.1 or 192.168.0.1).
  2. Find the “Port Forwarding” section.
  3. Add a rule specifying:
    • External port (e.g., 8080)
    • Internal IP of your device (e.g., 192.168.1.100)
    • Internal port (e.g., 80)
    • Protocol: TCP, UDP, or both

Step 6: Important Notes

  • Make sure the internal device has a static IP address.
  • Only open necessary ports to reduce security risks.
  • Use strong passwords and security configurations on exposed services.

Next Steps

Test your port forwarding using services like canyouseeme.org. Port forwarding is powerful, but should be used cautiously to avoid exposing your network.