0

I want to know which is the port used by my system on accessing a particular URL. Suppose the URL is ip_address:9081/abc Is the software port 9081 of my system is being used to access the URL? How can I identify it? Is there any command to identify the used port for a particular URL?

2
  • No, your system port is choosen randomly (from pool of free ports usually); it can be altered by routers, firewalls etc. Other system port is 9081, they are absolutely independent.
    – Arvo
    Jan 15, 2013 at 8:10
  • By "port" do you mean the local source port for the TCP connection? If so, Arvo's comment is correct. The TCP/IP stack chooses one randomly. (The application can bind to a specific port if it wishes to, but generally there's no reason to do so.) Jan 15, 2013 at 8:11

1 Answer 1

1

No, 8081 is the port you are connecting to (in the server). To know the local port of the connection (wich usually is random in high values of the port range) exec netstat command when you have a connection stablished (works in windows, and unix-like systems.)

You must log in to answer this question.