Question : Problem: Port forwarding Source = ANY, Destination = Port Number or Range

I am suddenly working with a router were Port forwarding works in a manner I am unfamiliar with.

For example, if I wanted to open Port 5631 for TCP, logic tells me Source Port = 5631 and Destination Port = 5631.

On this router, however, the only way it works is Source Port = ANY and Destination Port =5631.

The tech tried to explain why, but I do not think he knew.

Can anyone shed light?

Answer : Problem: Port forwarding Source = ANY, Destination = Port Number or Range

Source Port = Any and Destination Port = 5631 is correct.

To understand a little bit. In a tcp connection, 5 tuples are used for connection and they're;

Source IP, Source Port, Destination IP, Destination Port, Protocol.

So from your pc, if you were to browse to www.yahoo.com, what would be the values for them. The following I can predict right now;

Source IP = Your natted IP address

Source Port = Anything above 1024 (I can't predict this)

Destination IP = yahoo's ip address

Destination Port = 80

Hope this helps. So basically when we port forward something, we're forwarding *to* the port on which a particular tcp/ip application would be *listening*. The source port selection while making a connection is random.

Now, how can you find out if I'm telling crap or true?

1. Go to www.wireshark.org and then the sniffer.
2. Install it on your machine.
3. Open it and start the capture.
4. Then you open a browser and go to a normal web page.

Then stop capture; look at the logs, you can find that the source port and destination port are not the same. Destination port will be 80 (because that is the standard port on which http listens), your source port will be random, something above 1024 (Upto 1024, the ports are reserved for applications).

HTH

Cheers,
Rajesh
Random Solutions  
 
programming4us programming4us