Port Forwarding Rule Generator

Generate port forwarding configurations for your router brand. Enter the external port, internal IP and port, select your protocol, and get ready-to-use configurations for TP-Link, Netgear, Asus, and Linux iptables — plus command-line formats for advanced setups.

Port Forwarding Rule Generator
Figure 1 — Port Forwarding Rule Generator

What Is Port Forwarding?

Port forwarding tells your router to send incoming traffic on a specific port to a particular device on your local network. By default, your router's NAT firewall blocks all unsolicited inbound connections. Port forwarding creates an exception for services you want to be accessible from the internet — like game servers, web servers, or remote access tools.

For a complete setup walkthrough, see our port forwarding guide. To learn the concepts behind it, read What Is Port Forwarding?

When Do You Need Port Forwarding?

Use CasePortsProtocolNotes
Minecraft Server25565TCPJava Edition default
Plex Remote Access32400TCPFor streaming outside your network
Xbox Open NAT3074TCP/UDPFixes matchmaking issues
PlayStation NAT3478-3480TCP/UDPPlus 3074 UDP
Web Server80, 443TCPHTTP and HTTPS
SSH Remote Access22TCPConsider changing to non-standard port
WireGuard VPN51820UDPModern VPN protocol
Security CamerasVariesTCPUse VPN instead when possible

Use our Common Ports Reference to look up the correct ports for your specific service. Verify ports are open after configuration with our Port Checker.

How to Access Your Router

To apply port forwarding rules, you need to log in to your router's admin panel. Most routers use one of these addresses:

  • 192.168.1.1 — Most common (TP-Link, Netgear, Linksys)
  • 192.168.0.1 — Netgear, D-Link, some TP-Link
  • 10.0.0.1 — Xfinity, AT&T gateways
  • 192.168.2.1 — Belkin routers

If you're not sure of your router's IP, it's your default gateway. Learn more in our gateway guide. Make sure your device has a static IP (or DHCP reservation) so the forwarded port always reaches the right device.

Pro Tip: Always assign a static IP or DHCP reservation to the device receiving forwarded traffic. If your device's IP changes via DHCP, the port forwarding rule will point to the wrong device. Set up a DHCP reservation in your router's settings — it's easier than configuring a static IP on each device. Use our DHCP Lease Calculator to plan your address pool.

Note: If you have a double NAT setup (two routers in series), you need to configure port forwarding on both routers, or put the inner router in the DMZ of the outer router. Double NAT is the most common cause of port forwarding not working. Test your setup with our Port Checker after configuration.

Port Forwarding Security Considerations

Every forwarded port is an opening in your firewall. Follow these security practices:

  1. Only forward ports you need — Remove rules for services no longer in use.
  2. Use non-standard ports — Change SSH from 22 to a high port to reduce automated attacks.
  3. Prefer VPN over port forwarding — A VPN provides encrypted access to your entire network without exposing individual ports.
  4. Keep services updated — Exposed services must be patched promptly.
  5. Monitor access logsMonitor network traffic for unusual connections to forwarded ports.
  6. Use strong authentication — Any internet-exposed service needs strong passwords or key-based auth.

Troubleshooting Port Forwarding

If your port forwarding isn't working after configuration, check these common issues:

ProblemLikely CauseSolution
Port shows as closedISP blocking portTry non-standard port; contact ISP
Works locally, not remotelyDouble NATBridge modem or forward on both routers
Intermittent accessDynamic IP on target deviceSet DHCP reservation or static IP
Wrong protocol selectedTCP vs UDP mismatchCheck service requirements; use Both
Firewall blockingDevice firewall activeAdd exception in OS firewall

After configuring, verify with our Port Checker. If using port forwarding for gaming, check your NAT type has changed to Open.

Key Takeaways
  • Port forwarding directs external traffic through your NAT firewall to a specific internal device.
  • Always use a static IP or DHCP reservation for the target device.
  • Select the correct protocol (TCP, UDP, or both) based on the service requirements.
  • Check for double NAT if port forwarding doesn't work after configuration.
  • Prefer VPN access over port forwarding for better security.
  • Verify your rules work with the Port Checker after setup.

Video: How to Set Up Port Forwarding

Related Tools & Guides

Frequently Asked Questions

Is port forwarding safe?

Port forwarding itself is not dangerous, but it exposes a service to the internet. Ensure the exposed service is patched, uses strong authentication, and is actively monitored. For remote access, a VPN is generally more secure than forwarding individual ports.

Do I need port forwarding for gaming?

Many games work without port forwarding thanks to UPnP. However, if you have Strict or Moderate NAT type, forwarding the game's ports can improve matchmaking and voice chat. Console gaming especially benefits from port forwarding.

Why is my port forwarding not working?

Common causes: double NAT (two routers), ISP blocking the port, wrong protocol (TCP vs UDP), device firewall blocking traffic, or the target device's IP changed. Use our Port Checker to diagnose.

What is the difference between port forwarding and DMZ?

Port forwarding opens specific ports to a device. DMZ forwards ALL ports to a device, effectively removing it from NAT protection. DMZ is simpler but much less secure. Only use DMZ for dedicated servers or as a last resort.

Can I forward the same port to multiple devices?

No. A port can only be forwarded to one internal IP address. Use different external ports that map to the same internal port on different devices if needed (e.g., external 25565 to Device A, external 25566 to Device B).

Should I enable UPnP instead?

UPnP allows devices to automatically create port forwarding rules. It's convenient but less secure since any device on your network can open ports. For gaming consoles, UPnP is usually fine. For servers, manual port forwarding gives you more control.

About Tommy N.

Tommy is the founder of RouterHax and a network engineer with 10+ years of experience in home and enterprise networking. He specializes in router configuration, WiFi optimization, and network security. When not writing guides, he's testing the latest mesh WiFi systems and helping readers troubleshoot their home networks.

Promotion for FREE Gifts. Moreover, Free Items here. Disable Ad Blocker to get them all.

Once done, hit any button as below