In Port Address Translation, PC with Private IP address sends a packet with Destination address as a public IP address to the router. The router changes the Source address to the public router address and assigns a random port number for response. When packet reaches the destination, it should see return address and port. The destination sends a packet with routers public ip and same port. The router then remaps the packet to internal ip using the port number information. The port then stops listening after a timeout.

Websites like Whatismyip show only the routers public ip and not the port. How can I find the port number?

If the port number is found, can I use this as a temporary Port Forwarding? For example, send a packet to router public ip:port to connect to the computer. Or will the router ignore it because the source address was different compared to the destination address of the packet sent.


I have not tried it myself, yet, but I wonder if Wireshark would display the IP:Port in any of the packets it captured.

  • The packet with the port will be between the router and destination. To use any packet analyzer, I would have to be on the public internet on one of the route the packet passes through. Is there a web service or a some other method that can tell me the port? – fanix May 25 '17 at 12:02
  • @fanix If you can run tcpdump, tshark or similar on your router, that would suffice. – user4556274 May 25 '17 at 12:16
  • I don't have access to the router that has a public IP. I have a WiFi router, which connects to my building's router which connects to ISP's router which has the public IP, I think. – fanix May 25 '17 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.