Friday, May 22, 2009

netstat examples

To get routing information:-

netstat -rn

protocol statistics

netstat -sP tcp ,
netstat -sP udp
netstat -sP ip
netstat -sP icmp



To determine which daemons are currently running or which daemons will be started by inetd

netstat -ap --inet | LISTEN



connections to hosts outside a masqueraded n/w

netstat -M or netstat --masquerade


to display only listening sockets

netstat -l


to display only unix domain sockets

netstat --unix -l


to display only internet TCP sockets

netstat --inet -l


to get interface information

netstat --interface

( to obtain information similar to what ifconfig returns , use -c to refresh o/p every second)



To display information about programs that are using n/w connections

netstat --program


to display information from route cache

netstat -C


to display Active TCP connections

netstat -natp


to display Active UDP connections

netstat -napu

No comments:

Post a Comment