Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
up vote 1 down vote accepted

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

share|improve this answer
    
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] – user1702061 Jun 11 '13 at 7:23
    
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 Jun 11 '13 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .