How to set up port mapping for an IP camera

Forwarding the RTSP port on popular routers

Port mapping, port forwarding, “virtual server” and “port redirection” are different names for the same setting. It directs a request from an external port on the router to the RTSP port of a camera on the local network.

Once it is set up, the rtsp.me server will be able to fetch the camera’s video stream at the public address.

Check an RTSP link
Diagram of an external RTSP port on a router being forwarded to the local port of an IP camera
The router receives a request on the public IP and external port, then forwards it to the IP address and RTSP port of the camera on the local network.

How port forwarding works

Suppose the camera has the local address 192.168.1.100 and accepts RTSP on port 554. On the router you can open external TCP port 10554 and direct it to the camera:

Internet:10554 → router → 192.168.1.100:554

The public RTSP link uses the router’s external IP or DDNS name together with the external port:

rtsp://login:password@public-ip:10554/stream-path

The /stream-path depends on the camera manufacturer. Examples are given on the page “Where to find your camera's RTSP link”.

Before you start

Gather the camera details and make sure a direct connection is possible.

  1. Check your public IP. The router’s WAN address must be public. If it falls within the ranges 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 or 100.64.0.0/10, your ISP is probably using NAT or CGNAT.
  2. Find the camera’s local IP. For example, 192.168.1.100.
  3. Fix the camera’s address. Create a DHCP reservation against its MAC address so the rule does not stop working after a reboot.
  4. Check the RTSP port. Port 554 is commonly used, but the camera may be set to a different one.
  5. Test RTSP locally. Make sure the camera delivers a stream inside the network before you change anything on the router.
If you have two routers, if your ISP’s modem also acts as a router, or if the WAN address is not public, a single rule may not be enough. You will need forwarding on each router, bridge mode on the ISP’s equipment, or help from an administrator.

Fields in the rule

The names differ, but almost every router asks for the same values:

Save the rule and enable it. Do not create a port range if you only need one RTSP port.

Keenetic

  1. Open the router’s web interface, usually my.keenetic.net or its local IP.
  2. In the home devices section, select the camera and register a permanent IP address for it.
  3. Open Network rulesForwarding.
  4. Create a rule for the “Provider” inbound interface, protocol TCP and external port 10554.
  5. Choose the camera as the destination device and set the internal port to 554.
  6. Save the rule and make sure it is enabled.

Depending on the KeeneticOS version, the section may be labelled “Forwarding” or “Port forwarding”.

TP-Link

  1. Open tplinkwifi.net or the router’s local address.
  2. Fix the camera’s IP in AdvancedNetworkDHCP ServerAddress Reservation.
  3. Go to AdvancedNAT ForwardingVirtual Servers.
  4. Add a rule: External Port — 10554, Internal IP — the camera’s address, Internal Port — 554, Protocol — TCP.
  5. Enable the rule and save the settings.

In the older interface the section may be called ForwardingVirtual Servers.

ASUS

  1. Open router.asus.com or the router’s local address.
  2. Fix the camera’s address: LANDHCP Server → manual IP assignment.
  3. Go to WANVirtual Server / Port Forwarding.
  4. Enable Port Forwarding and add an RTSP Camera profile.
  5. Set External Port 10554, the camera’s Internal IP, Internal Port 554 and Protocol TCP.
  6. Apply the settings.

MikroTik

In RouterOS the rule is created under IPFirewallNAT. You will need administrator rights and an understanding of which interface is the inbound WAN.

  1. Add a rule with Chain dstnat, Protocol tcp, Dst. Port 10554 and the inbound WAN interface.
  2. On the Action tab, choose dst-nat.
  3. Set To Addresses to 192.168.1.100 and To Ports to 554.
  4. Make sure the Firewall Filter rules allow this forwarded connection.
/ip firewall nat add chain=dstnat in-interface=<WAN> protocol=tcp dst-port=10554 action=dst-nat to-addresses=192.168.1.100 to-ports=554 comment="RTSP camera"

Do not paste the command without first checking the WAN interface name, the local subnet and your current firewall policy.

Huawei and ZTE

Routers and ONTs from these manufacturers are often supplied by the ISP. The menu items available and your user rights depend on the model and the operator’s settings.

  1. Open the device’s local address, given on its label or in the ISP’s instructions.
  2. Find the Forward Rules, NAT, Port Mapping or Virtual Server section.
  3. Select the WAN connection that has internet access.
  4. Set the external port to 10554, the camera’s internal IP, internal port 554 and protocol TCP.
  5. Save and activate the rule.

If the section is hidden or the settings are unavailable, contact your ISP. Do not use service passwords found on the internet.

Xiaomi and Redmi

  1. Open miwifi.com or the router’s local address.
  2. Fix the camera’s local IP, if the firmware offers DHCP reservation or a static IP.
  3. Find AdvancedPort Forwarding or Port Mapping.
  4. Create a TCP rule: external port 10554, the camera’s IP, internal port 554.
  5. Save the rule.

The set of features differs between official and regional firmware. If port forwarding is not available, use a different router or an alternative way of connecting the camera.

Checking the setup

  1. Insert the public IP or DDNS name and the external port into the RTSP link.
  2. Open rtsp.me, paste the link and click “Test”.
  3. Wait for the result: the check is performed remotely by the rtsp.me server.

If there is no connection, compare the router’s WAN address with your public address and check the camera’s IP, the ports and the protocol. Make sure the rule is enabled and is not tied to the wrong WAN interface.

A site that checks an ordinary TCP port may report an error even when RTSP is set up correctly, or the other way round. You can test the full RTSP link on the rtsp.me home page: the check is carried out remotely by the service itself.

Security

If your security rules prohibit inbound connections, use MyVMS Bridge or RTMP Push instead of opening a port.

Frequently asked questions

Which port should I forward?
The camera’s actual RTSP port, often TCP 554. The external port may differ: for example, 10554 on the outside and 554 inside.
Should I choose TCP or UDP?
Set up TCP for connecting to rtsp.me. If the router interface does not let you select TCP alone, the combined TCP/UDP mode can be used.
Why has the rule stopped working?
A common cause is a change in the camera’s local IP. Fix the address with a DHCP reservation and check that the camera is still using the same RTSP port.
Everything is set up, so why is the camera unreachable?
Check for CGNAT, double NAT, the WAN interface you selected, the firewall, and inbound port blocking by your ISP.
Can I manage without port mapping?
Yes. Without a public IP, or where inbound connections are prohibited, use MyVMS Bridge, RTMP Push on a compatible camera, or a ready-made rtsp.me camera.

Test your RTSP port forwarding

Build an RTSP link using the public IP or DDNS name and the external port. The remote rtsp.me check will show whether the video stream is reachable.

Check an RTSP link