About port forward, different IP address but same ports

1

For example, I have two PC, the IP address (already set as static) of one is 192.168.1.1 and another one is 192.168.1.2

In each of them, I need to use two ports, e.g. 300 and 400

So I would need to use links as below:

192.168.1.1:300    
192.168.1.1:400    
192.168.1.2:300    
192.168.1.2:400

So does that mean I need to do port forwarding 4 times? Or I only need to do port forwarding for an IP, for example 192.168.1.1 and then there would be some way I could access all the ports for that IP?

Thanks!

MW_hk

Posted 2013-06-11T05:22:22.607

Reputation: 113

Answers

1

You are not specifying where you are setting the port forwarding. I am going to assume it's on the router that is connecting the 2 PCs to the internet.

You could either set those IPs as being part of DMZ - in that case ALL of the ports are open - caution here, it's a security risk!

or you can setup the router to forward the ports, but you need to do it the following way:

Let's say public IP is 8.8.8.8 you would set it up as:

8.8.8.8:301 -> 192.168.1.1:300 8.8.8.8:302 -> 192.168.1.1:400 8.8.8.8:303 -> 192.168.1.2:300 8.8.8.8:304 -> 192.168.1.2:400

The reason for that is that the router can only translate 1 port on the external IP to 1 port on the interla IP - this is called NAT. If you need more info, look at here: NAT on WiKI

TomEus

Posted 2013-06-11T05:22:22.607

Reputation: 3 355

For example if I am using port forwarding service from a third party (e.g. dyn.com) I will still have to set for four times, right? [e.g. thirdparty.com:301 -> 192.168.1.1:300 thirdparty.com:302 -> 192.168.1.1:400 thirdparty.com:303 -> 192.168.1.2:300 thirdparty.com:304 -> 192.168.1.2:400] – MW_hk – 2013-06-11T07:23:58.157

yes you will, there is no other way around that - if you like mu answer, please accept it and place a vote - really appreciate it, Thank you! – TomEus – 2013-06-11T15:55:54.517