[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] Port numbers



* Joost Kooij (joost@topaz.mdcc.cx) [010712 05:22]:
> On Thu, Jul 12, 2001 at 12:24:17AM -0500, will trillich wrote:
> > How do you determine WHICH NETWORK SERVICES ARE OPEN (active)?
> > Try "netstat -a | grep LISTEN". To see numeric values (instead
> > of the common names for services using a particular port) then
> > try "netstat -na" instead. For more info, look at "man netstat".
> 
> As root, you can also use the '-p' option to netstat, to display
> the process id/name that is attached to the open port.
> 
> > Curious about your NETWORK TRAFFIC? There's a whole bunch of
> > ways to monitor it: iptraf, showtraf, netwatch, tcpview, statnet,
> > or even
> > 	tcpdump | grep 'what you want to see'
> 
> tcpdump has its own filter, which is much more effective in 
> terms of resource usage.  It actually compiles a filter from
> the specification you give it on the command line.  
> 
> Example:  
>   tcpdump host foo
>   tcpdump not port ssh
>   tcpdump port 53
>   tcpdump arp
>   
> > 	lsof -i | grep 'LISTEN'
> 
> lsof is different from the other tools you mention.  It does not
> 

but it does allow matching of internet addresses by protocol,
hostname/addr and/or port/servicename (just not state, so you'd have
to grep for LISTEN, but not for things like

lsof -i tcp
or
lsof -i @localhost

I'm guessing it doesn't make any difference in resource usage, though.

Vineet

Attachment: pgpxqp9lEUMRL.pgp
Description: PGP signature


Reply to: