Multiple Servers Behind a NAT Router


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. So, to get around this we’ll use multiple ports on the public facing IP address. In our example 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.

So to access multiple devices on your network, you will need 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
The Network Diagram in our example looks like this.multiple-servers-behind-a-nat-router
Since our computers on our local network are all using port 5190, we do not need to change the port number from which those services run.  We’ll instead make the change on our router.  In this example we are using DD-WRT supported router, an open source router firmware. Your firmware may be different, but the process will be similar.
ddwrt port-forwarding
Apply the changes to your router and now you should be able to connect to your No-IP host.  The only thing we will do differently is specify a port number to connect to.  With this particular application, you can specify the port after the hostname. Other applications might give you a separate field to enter the port number. The important thing to notice is that the port number is 5192, which will take us to vnc-server3, which is 192.168.1.40 on port 5190.VNC Chicken Login