Operating System - HP-UX
1832108 Members
3018 Online
110038 Solutions
New Discussion

Identifying network port pairs

 
SOLVED
Go to solution
George Spencer
Occasional Contributor

Identifying network port pairs

Is there a fast way of identifying the network port pairs? I am trying to identify the local and remote port pairs that are in use at a particular point in time, and found that netstat takes forever, and ndd is unreliable. Is there a simple method that I am missing?
3 REPLIES 3
Stefan Farrelly
Honored Contributor

Re: Identifying network port pairs

Use lsof, it will do it. You can download from;

http://hpux.cs.utah.edu/ftp/hpux/Sysadmin/lsof-4.64/
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ron Kinner
Honored Contributor
Solution

Re: Identifying network port pairs

Instead of netstat -a try
netstat -an
or better
netstat -an |grep tcp

The delay is caused by netstat looking up the hostname for each IP address via DNS. The n option says just give us the ip address and don't worry about the hostnames.

Ron
Michael Steele_2
Honored Contributor

Re: Identifying network port pairs

lsof -i tcp:23 (* list open files for tcp socket 23 *)

lsof -i udp:123 (* list open files for udp socket 123 *)

Support Fatherhood - Stop Family Law