Q: udp port <=> PID

Q: udp port <=> PID

Post by Imre Kolo » Tue, 24 Nov 1998 04:00:00



Is there a way to tell which process uses a particular UDP port ?

A Solaris 2.6 machine generates big udp traffic. I can snoop where
does this traffic go to and can see the UDP port number, I would
like to know to which process this port belongs. I tried pfiles but that
did
not work out for me.

thanks,
Imre

 
 
 

Q: udp port <=> PID

Post by Vic Abe » Tue, 24 Nov 1998 04:00:00



>Is there a way to tell which process uses a particular UDP port ?
>A Solaris 2.6 machine generates big udp traffic. I can snoop where
>does this traffic go to and can see the UDP port number, I would
>like to know to which process this port belongs. I tried pfiles but that
>did
>not work out for me.

Try lsof:

        ftp://vic.cc.purdue.edu/pub/tools/unix/lsof

$ netstat -an
UDP
   Local Address         Remote Address     State
-------------------- -------------------- -------
      *.111                                 Idle
...

$ lsof -i udp:111
COMMAND PID USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
rpcbind 120 root    3u  inet 0x60b49540      0t0  UDP *:sunrpc (Idle)