Skip to content

Multiple Servers Behind a NAT Router

Article Summary

  • Port forwarding lets you use each inbound port only once, so multiple devices behind one public IP need different public ports.
  • Map a different public port to each machine's internal address, even when every machine runs the service on the same port.
  • In the example, public ports 5190, 5191 and 5192 map to 192.168.1.20, 192.168.1.30 and 192.168.1.40 on port 5190.
  • The same approach works for any service, such as a web server, Windows Remote Desktop or a security camera.

You have three computers behind a NAT router (network address translation). These three machines all communicate out of one public IP address. To access these hosts from the public interface on your router, you must configure port forwarding.
With port forwarding you can only use the inbound port once. To get around this we’ll use multiple ports on the public facing IP address. In our example we will use a remote access service like VNC, which usually runs on port 5190. This is just an example and this would apply to any service such as a web server, Windows Remote Desktop or security camera.
To access multiple devices on your network, you will need to set up different ports.
In this example:
  1. Public port 5190 will map to the PC on our local network with address 192.168.1.20 on port 5190

  2. Public port 5191 will map to the PC on our local network with address 192.168.1.30 on port 5190

  3. Public port 5192 will map to the PC on our local network with address 192.168.1.40 on port 5190