1.Introduction

To watch the live view of Network Camera or NVR remotely, you need to map the ports on a router for Network Camera or NVR.

Port Mapping of a router is required to allow access to your network device. However, the Port Mapping setup is reliant upon the specific brand and model number of the router being used. Regardless of the router brand, the configuration process is largely similar. This article will take the Milesight router as an example for specific illustration. 

Next, we need to configure the network parameters to ensure that the device can be accessed normally via the network. This mainly includes setting the device's IP address and opening the corresponding ports according to the device type.

 
 

2.Core Parameter Description

 

Taking the Milesight network camera as an example, you need to confirm the device's internal network IP and service ports in advance for remote access. The parameters are as follows.

Product Line

HTTP Port

RTSP Port

NVR

80

554

Network Camera

80

554

Note:

1.The default HTTP port for web browser access is 80, and the default RTSP port for video stream transmission is 554. If you need to view the images through the web interface, generally, these two ports must be mapped.
2. Before performing port mapping, it is recommended to change the default port to another port number. For example, change port 80 to 8101 or modify the default port of the web browser. This is because in some countries, the use of port 80 may be restricted, and keeping the default port may cause the camera to be inaccessible due to unknown issues.
3.If you have multiple cameras and network video recorders, you should make sure that the port numbers for them are different.
4.During the process of forwarding, please choose the protocol as TCP, rather than Auto or UDP.

 

Figure 1 NVR Network settings

 

Figure 2 Network Camera Network setting

 
 

3. Manual Port Mapping Steps


The following steps take Network Camera as an example. The configuration logic for NVR is the same—only the target IP needs to be replaced.

IP address

HTTP port

RTSP port

Network Camera

192.168.69.110

Source Port :8888

Source Port:8889

Router

192.168.45.143

Destination Port :80

Destination Port:554

Note:

The Destination Port refers to the internal port on network camera, and the Source Port refers to the external port on the router.

 

Step 1: Log in to the Router Management Interface

Open a web browser and enter the internal network management IP of the Milesight router (192.168.45.143) in the address bar, then press Enter.

Some routers/modems require a username and/or password. If yours does, enter the router's username and password, then click "Log In" (see Figure 3).

 

Figure 3 Router log in

Step 2: Access the Port Mapping Configuration Page

After logging in to the router's web GUI, go to Network > Firewall > Port Mapping to enter the rule configuration page.(see Figure 4)

 

Figure 4 Access the Port Mapping Configuration Page

 

Step 3: Configure HTTP Port Mapping Rule (for Camera Web Access)

Click "Add Rule" and fill in the parameters as follows (see Figure 5):

lSource IP: Fill in 0.0.0.0/0 (allows all external devices to access).

lSource Port: Set to 8888 (a user-defined TCP port for the router to receive incoming requests; ensure this port is not occupied by other services on the router. If occupied, go to Network->Firewall->Security to modify the conflicting port first).

lDestination IP: Enter the Network Camera's local IP address 192.168.69.110 (the subnet device to be mapped).

lDestination Port: Set to 80 (the http port of the Network Camera, as the Network Camera uses http port for web access).

lProtocol: Select TCP (since Network Camera web access relies on TCP).

Figure 5 Set up HTTP port mapping

 

Step 4: Configure RTSP Port Mapping Rule (for Video Stream )

Repeat the "Add Rule" operation and configure the parameters as follows (see Figure 6):

lSource IP: 0.0.0.0/0

lSource Port: Set to a user-defined TCP port (8889; must be different from the HTTP source port to avoid conflicts).

lDestination IP: 192.168.69.110 (consistent with the Network Camera's internal network IP).

lDestination Port: 554 (consistent with the Network Camera's RTSP port).

lProtocol: Select TCP.

lClick "Save" to complete the RTSP rule configuration.

Figure 6 Set up RTSP port mapping

 

Step 5: Verify Remote Access Effect

lCamera Web Access Verification:

In an external network environment , open a browser and enter "Router's Public IP + HTTP Source Port". If you can redirect to the Network Camera's web login interface (see Figure 7), the HTTP mapping is effective.

 

Figure 7 Log in Network Camera 

 

lRTSP Video Stream Verification:

Open VLC media player, go to Media > Open Network Stream, enter the RTSP address (rtsp://IP:RTSP Port/main), and enter the Network Camera's account and password. If you can play the live stream (see Figure 8), the RTSP mapping is effective.

 

Figure 8 Play RTSP stream by VLC player

The final effect is as shown in the figure below. 


4. Automatic configuration steps

 

If the router supports UPnP (Universal Plug and Play) functionality, you can trigger port mapping automatically through the device side without manually configuring rules on the router.

 

Step 1: Enable UPnP Functionality

Enable UPnP on the Device Side:Log in to the web interface of the Network Camera/NVR, go to Network > UPnP, and check "Enable UPnP" and "Enable Port Mapping" (see Figure 9).

Note: The second figure shows the UPnP configuration interface of the NVR, with the same operation logic as the Network Camera.

 


Figure 9 Upnp Network settings

 

Step 2: Select Port Mapping Mode

lAuto Mode (see Figure 10):

On the UPnP configuration page of Network Camera or NVR, select "Auto" for "Forwarding Type". The router will automatically assign external ports for protocols such as HTTP, HTTPS, and RTSP—no manual specification is required.

  

Figure 10 select Auto type

 

lManual Mode (see Figure 11):

If you need to customize the external port, select "Manual" for "Forwarding Type". Enter the specified port in "External Port" (example: 21202 for HTTP, 23202 for RTSP) and enter the port of Network Camera or NVR in "Internal Port" (80 for HTTP, 554 for RTSP). 

Figure 11 select Manual type

 

Click "Save" to complete the automatic mapping configuration.

The final effect is as shown in the figure below.

 

 

5.Common Issues and Solutions

 

1. IPC Cannot Be Added to NVR/CMS After Port Mapping: After mapping the HTTP and RTSP ports for the Network Camera, it cannot be added to the NVR or CMS.

It is recommended to configure the RTSP port so that the internal and external ports are the same, for example, both set to 5554.

If it still fails, try manually entering the corresponding internal and external ports in the UPnP interface of Network Camera.


2. Camera web live view stream failed: After mapping the HTTP and RTSP ports, the network camera's web page can be accessed, but fail to get the video stream

 

lDue to camera usually established via HTTP connection but the video streaming is transferred via RTSP. So if you could access camera web interface but cannot get the live view stream. It should be due to RTSP port issueyou could check if the RTSP port is mapped correctly. It is also possible that the default RTSP port 554 has been blocked by the ISP. In this case, it is recommended to use a different port for mapping. 

 

 

If you are still having trouble configuring port forwarding for your network camera or NVR, please contact support@milesight.com for technical assistance.

 

 

——— END ———