netstat local and foreign address relationship.

Hi All,

Can you please help me in understanding the relationship between local and foreign address in the output of netstat -an.


Output 1
----------

162.103.162.37.50224 162.103.162.35.9511  49640      0 49640      0 ESTABLISHED
162.103.162.37.50263 162.103.162.35.9512  49640      0 49640      0 ESTABLISHED

Output 2
----------

162.103.162.37.22    10.92.99.173.62137   64512      0 49640      0 ESTABLISHED

At risk of stating the obvious, any link or connection starts at a port on your local host and ends on some port on remote hosts (or vice versa). That's what the two mean. Example from my node:

Proto Recv-Q Send-Q Local Address   Foreign Address         State      
tcp        0      0 10.1.1.1:43025  unix.com:http           ESTABLISHED

Disregarding the first three columns it states that there's an established connection from my node on my private net using port 43025 to unix.com 's www port, used for exactly the actual session.

1 Like