Skip to main content

How to set up port forwarding in your router

Open a port for your camera in your router, check for CGNAT, and fix a port that stays closed.

Written by Ondrej Lanc

Port forwarding opens a port on your router so that Angelcam can reach your camera from the internet. It works, but it’s the hardest and least secure way to connect a camera. This guide shows how to open the port in your router and what to do when it stays closed. To add the camera in MyAngelcam, see How to connect a camera using port forwarding.

Try this first: you don’t need port forwarding with an AngelBox, an AngelCamera, or any device running the Angelcam Connector. They connect out to Angelcam, so nothing on your router needs to change and your camera isn’t exposed to the internet. See The best alternatives to port forwarding.

Before you start

  • You need your camera’s local IP address (for example 192.168.1.21) and the port of its video stream: usually 554 for RTSP (H.264 or H.265) or 80 for MJPEG over HTTP.

  • Give the camera a fixed local IP address (a DHCP reservation in your router). If the address changes, the port forwarding rule stops working.

  • You need access to your router’s administration. See How to find your router administration.

Check that port forwarding can work (CGNAT)

Many internet providers share one public IP address between many customers. This is called CGNAT, and port forwarding can’t work behind it, however you set up your router. It’s common with mobile (4G/5G) internet, Starlink, and some fiber and cable providers.

To check it, open your router’s status page and find its WAN IP address, then compare it with what whatismyip.com shows. You’re behind CGNAT if:

  • the WAN IP starts with 100.64. to 100.127., or

  • the two addresses are different.

MyAngelcam can’t detect CGNAT for you. If you’re behind it, use an AngelBox, an AngelCamera or the Angelcam Connector, or ask your provider for a public IP address.

Set up the rule in your router

  1. Log in to your router’s administration.

  2. Find the port forwarding section. Depending on the router, it’s called Port Forwarding, Virtual Server, NAT or Firewall.

  3. Create a new rule:

    Port forwarding section in the router administration.
    • Name: anything you like, for example Shop camera.

    • Protocol: TCP. If your router only offers TCP and UDP together (Both or Any), that’s fine too.

    • IP address: your camera’s local IP address.

    • Local (internal) port: the camera’s stream port, for example 554. If the router asks for a range, enter 554-554.

    • Public (external) port: the port Angelcam will connect to. Using the same number as the local port is simplest.

    A port forwarding rule filled in for a camera.
  4. Save the rule.

    The saved port forwarding rule in the router.

Note: Some routers can only forward a port for one camera. If you have several cameras, give each one a different public port. See How to set up port forwarding for multiple cameras.

Next step: connect the camera in MyAngelcam

Once the port is open, add the camera in MyAngelcam. See How to connect a camera using port forwarding.

When the port stays closed

If MyAngelcam says the port is closed after you set up the rule:

  • Check the rule: the camera’s local IP address, the ports and the protocol.

  • Check that the camera still has the same local IP address.

  • Check for CGNAT.

  • Two routers? If your provider’s modem is also a router, the traffic passes through both (double NAT). Either switch the modem to bridge mode, or forward the port on both: on the modem to the second router’s address, and on the second router to the camera.

  • Some providers block common ports. Try a different public port, for example 10554.

Testing tip: the DMZ option in your router sends all incoming traffic to one device. If the camera works with DMZ on, the port forwarding rule is wrong. Turn DMZ off right after the test: leaving it on exposes the camera completely.

Keep your camera secure

An open port lets anyone on the internet try to reach your camera. To lower the risk:

  • Forward only the port the stream needs, and only to the camera.

  • Change the camera’s default password to a strong one.

  • Keep the camera’s firmware up to date.

  • If your router supports it, allow the port only for Angelcam’s servers. The list of addresses is in IP whitelist.

If your public IP address changes from time to time, use a dynamic DNS hostname instead of the IP address.

Did this answer your question?