Will It Work? · Guide

Port forwarding for a console or camera: what the router needs

By , founder of ElectronicsInfoline (since 2000)

A security camera you want to view from work, a game server, a console that reports a NAT problem: each needs traffic from the internet to reach one device at home. Port forwarding is the router setting that does it. This guide is drawn from two router makers' support pages (one read on its US and India sites). Menus differ by model, so treat the paths here as examples.

Give the device a fixed address with a DHCP reservation, look up the port and protocol from the app's maker, and add a rule in the router's port-forwarding (or "virtual servers") page: port, protocol, device IP. Then check the router's WAN address. A rule only works from the internet if that address is public; a private one or one from 100.64.0.0 to 100.127.255.255 means a box upstream is in the way.

What a rule does

Port forwarding tells the router to direct incoming internet traffic on a specific port to a device on your local network (TP-Link). Without a rule, the router's firewall blocks every connection attempt that starts on the internet (NETGEAR). That is why an IP camera you want to watch from outside needs one (NETGEAR), and why gaming and remote access are the common reasons people set one up (TP-Link).

A port-forwarding rule lets one kind of inbound traffic through to one deviceThe internet on the left, the router in the middle, a camera at 192.168.0.106 on the right. A connection arrives at the router's WAN address on external port 9000 over TCP. The router has a rule: external port 9000, TCP, to 192.168.0.106, internal port 90, so the connection is passed to the camera on port 90. A connection on a port with no rule, such as 9100, is blocked, because the router's firewall blocks inbound connection attempts by default.interneta viewer approuterfirewall: blockrule9000 TCP → :90camera192.168.0.106:9000:90:9100×A rule needs three things1. the device's local IP address (keep it fixed)2. the port number 3. the protocol: TCP, UDP or both
Figure 1. With no rule, the router blocks connections that start on the internet. A rule names three things: the port, the protocol and the device's local IP address.

Before you start

A rule needs three pieces of information: the local IP address of the device, the port number the service needs, and the protocol (TCP, UDP, or both) (TP-Link). The port comes from the maker of the game, camera or app, not from the router.

The device must keep the same IP address (NETGEAR). If it gets a new one next week, the rule points at nothing. Set a static IP on the device or an address reservation on the router (TP-Link); the reservation guide shows how.

Add the rule

On one maker's routers, the page is at Forwarding > Virtual Servers, Advanced > NAT Forwarding > Virtual Servers, or Advanced > NAT Forwarding > Port Forwarding, depending on the model. Click Add, choose the service from the list or type the port, enter the device's IP address, and pick the protocol; if you are not sure, choose ALL (TP-Link). For a range such as 6000-6010, leave the internal port empty (TP-Link). Then read the WAN address on the status page and test from outside at http://WAN address:port; the maker's example is http://192.203.115.77:90 (TP-Link).

On the other maker's routers, go to ADVANCED > Advanced Setup > Port Forwarding/Port Triggering, keep Port Forwarding selected, click Add Custom Service, and fill in the name, the protocol (TCP/UDP if unsure), the external start and end port, and the device's IP. Leaving "use the same port range for internal port" ticked keeps external and internal the same (NETGEAR).

Two catches. First, rule order: on that maker's routers each inbound packet is checked against the top rule first, so a broad rule above a narrow one takes all the traffic (NETGEAR). Second, port 80: on the first maker's routers, it is the default for the router's own management page, so to forward it you first move that page to another port, such as 8080 (TP-Link).

Two devices, one port

External and internal ports are usually the same, unless you forward the same port to more than one device (TP-Link). Two cameras that both listen on port 90 cannot share external port 90. Give each its own: the maker's example uses external ports 9000 and 9001 to internal port 90 on 192.168.0.106 and 192.168.0.103 (TP-Link). Only some models allow the two numbers to differ (TP-Link).

Two devices on the same internal port: give each its own external portOne maker's example. Two devices, 192.168.0.106 and 192.168.0.103, both need port 90. Two rules use different external ports, 9000 and 9001, and the same internal port 90: WAN:9000 reaches the first device and WAN:9001 the second. If both rules used external port 90, the router would send every connection to whichever rule matches first, and the second device would never be reached.Different external ports: both workWAN:9000rule192.168.0.106:90WAN:9001rule192.168.0.103:90Same external port 90: the second never gets itWAN:90rule192.168.0.106:90WAN:90never reached192.168.0.103:90
Figure 2. Two rules, external 9000 and 9001, both to internal port 90. On many routers external and internal are the same number; use different ones only when two devices need the same internal port, and only if your model allows it.

When it cannot work

Port forwarding only works from the internet if the router has a public WAN IP address (TP-Link). If the status page shows a private address, another NAT device sits between your router and the internet, such as an upstream modem router, and you need to open the same ports on it too (TP-Link) (TP-Link). Some providers use carrier-grade NAT and give private addresses by default, which stops port forwarding over the internet (TP-Link). Carrier-grade NAT addresses run from 100.64.0.0 to 100.127.255.255; they look public but are not (TP-Link).

Read the router's WAN address before you blame the ruleThree WAN addresses as a router's status page might show them. 113.116.60.229 is public: the rule can be reached at http://WAN address:port. 192.168.1.20 is private: another NAT box, such as the provider's modem router, sits in front, and the same port must be opened on that box too. 100.72.15.9 is inside the carrier-grade NAT range 100.64.0.0 to 100.127.255.255, which looks public but is not: port forwarding will not work, and the fix is to ask the internet provider for a public IP address. Private ranges are 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.WAN 113.116.60.229publicthe rule can workreach it at http://WAN:portWAN 192.168.1.20privatethe rule alone failsopen the port there tooWAN 100.72.15.9carrier-grade NATthe rule alone failsask the provider for a public IPcarrier-grade NAT: 100.64.0.0 to 100.127.255.255private: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
Figure 3. Private (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) means a second box in front; 100.64.0.0 to 100.127.255.255 means carrier-grade NAT at the provider. Mobile (4G and 5G) providers usually give a private address.

Most 4G/LTE and 5G providers assign private addresses by default (TP-Link). The same maker notes that a carrier-grade NAT address also affects a console's NAT type (TP-Link). The fix is on the provider's side: ask for a public IP address. The remote management guide covers the same address check.

If it still fails

Test from inside first: if you cannot reach the camera or server on your own network, the problem is the device, not the router (TP-Link). Then check the rule's IP address, port and protocol (TP-Link). On a Windows PC acting as the server, the firewall can block the connection (TP-Link). If the device has a static IP typed in, its gateway should be the router's LAN address (TP-Link).

Avoid DMZ as a shortcut. It forwards everything to one device and removes the router's firewall protection for it (NETGEAR). If a console or app opens its own ports, see UPnP on or off.

Tips and tricks

  • Reserve the device’s IP address before you add the rule, or the rule breaks the next time the address changes.
  • Look up the port and protocol on the app or game maker’s own support page; the router cannot tell you.
  • Test from outside your network, such as a phone on mobile data with Wi-Fi off. Testing from inside does not prove the rule works.
  • Check the WAN address on the status page before you change anything else.
  • Delete rules you no longer use. Each one leaves that port on that device open to the internet.

What we would do

We would reserve the device's address, add one rule per port the maker lists, and test from a phone on mobile data. If the WAN address turned out to be private or in the 100.64.0.0 range, we would stop changing the router and ask the provider for a public IP address, or open the port on its box in front.

Questions people ask

What does port forwarding do? It tells the router to send incoming internet traffic on one port to one device on your home network. Without a rule, the router’s firewall blocks connections that start on the internet.

What do I need before I add a rule? Three things: the device’s local IP address, the port number the service uses, and the protocol (TCP, UDP or both). Get the port from the maker of the game, camera or app. Give the device a fixed address first, with a DHCP reservation.

Should I pick TCP, UDP or both? Use what the app’s maker lists. If you are not sure, one maker says to pick ALL and the other says TCP/UDP; both mean both protocols.

Why does my port forwarding not work? Check in this order: the device answers from inside your network; the rule has the right IP address, port and protocol; the computer’s firewall is not blocking it; and the router’s WAN address is public. A private WAN address means another router is in front; 100.64.0.0 to 100.127.255.255 means carrier-grade NAT at your provider.

Can I forward ports on 4G or 5G home internet? Usually not as it comes. One maker says most 4G/LTE and 5G providers assign private IP addresses by default, so a rule on your router cannot be reached. Ask the provider for a public IP address.

Can two devices use the same port? Not on the same external port. Give each its own external port pointing at the same internal port: the maker’s example is 9000 and 9001 to port 90 on two devices. Some models allow different external and internal ports; others do not.

Is DMZ the same as port forwarding? No. DMZ sends all inbound traffic to one device and removes the router’s firewall protection for it. A port-forwarding rule opens only the ports you name.

Sources

Each figure on this page is quoted from the source below or worked out from them. Sources checked , each quote read again against the source in a second pass.

  1. TP-Link, TP-Link FAQ 1379 (US): setting up port forwarding: Port forwarding tells your router to direct incoming Internet traffic on a specific port to a device on your local network. … It is commonly used for gaming, remote access, and hosting a server or website from home. … the local IP address of the device you are forwarding to, the port number your service requires, and the protocol (TCP, UDP, or ALL) … The External Port and Internal Port are usually the same, unless you are forwarding the same port to multiple devices. … assign a static IP address to your device or use address reservation on your router … Port forwarding only works from the Internet if your router has a public WAN IP address. … Go to Forwarding > Virtual Servers … Go to Advanced > NAT Forwarding > Virtual Servers … Go to Advanced > NAT Forwarding > Port Forwarding … If you are not sure, select ALL … If you need to enter a port range (for example, xx-xx), leave the Internal Port field empty. … http://WAN IP:port number (for example, http://192.203.115.77:90) … you must first change the router's remote management port, because port 80 is the default … such as 8080 … port 90 on both 192.168.0.106 and 192.168.0.103), create two separate rules using different External Ports (such as 9000 and 9001) and the same Internal Port (90) … there is another network address translation (NAT) device between your router and the Internet. You will need to open the required ports on that device as well. … Some ISPs (such as those using Carrier-Grade NAT, or CG-NAT) assign private IPs by default, which prevents port forwarding from working over the Internet. … Some models support different External Ports and Internal Ports. tp-link.com/us/support/faq/1379/
  2. TP-Link, TP-Link FAQ 785 (US): port forwarding not working: If the WAN IP is private or a CGNAT address (100.64.0.0–100.127.255.255), port forwarding will not work … Always verify the server is accessible from the local network before troubleshooting port forwarding rules. … Windows Firewall can block port forwarding connections. … Most 4G/LTE and 5G ISPs assign private IP addresses by default … including the correct internal IP address, port number, and protocol … the gateway on the client’s settings should be the router’s LAN IP address … prevent you from using OpenVPN or port forwarding and affect the NAT Type … you will need to open the same port on the upstream modem router as well tp-link.com/us/support/faq/785/
  3. NETGEAR, NETGEAR KB 24290: adding a custom port forwarding service: By default, the firewall of your NETGEAR router blocks all incoming connection attempts by devices on the Internet to devices in your local network. … Select ADVANCED > Advanced Setup > Port Forwarding/Port Triggering … If you are unsure, select TCP/UDP … Leave the Use the same port range for Internal port check box selected. … If you create more than one port forwarding rule, the order that they appear on the screen matters. … Each inbound packet is checked against the top rule first … all packets will get forwarded to server A and none to server B kb.netgear.com/24290/How-do-I-add-a-custom-port-forwarding-s…
  4. NETGEAR, NETGEAR KB 20917: what port forwarding is: The server device must always have the same IP address. … If your router and the server device on your local network both support UPnP, and UPnP is enabled in the router web interface, the required router configuration for inbound traffic occurs automatically. … setting up a DMZ removes all of your router’s firewall protection for a device … if you have an IP camera or FTP server on your network that you want to be accessible via the Internet kb.netgear.com/20917/What-is-port-forwarding

Author: Bulan Sarkar · Report an error

Numbers here are quoted from standards bodies and makers, or worked out from them. Nothing on this page was measured or tested by us.