Linux Network Tools - netstat
netstat is a command line tool that can list out all network (socket) connections on a system: TCP, UDP and Unix socket connections.routing tables, interface statistics, masquerade connections and multicast memberships.
List all connections
netstat -aList TCP connections
netstat -atList UDP connections
netstat -auList listening connections
netstat -lDisable reverse DNS lookup
netstat will try to find the hostname of each IP address by doing a reverse DNS lookup. This is slow.
netstat -nList Process Name/ID
It is useful to know what process is using particular port.
netstat -pDisplay Routing Table
Routing tables are used to compute the path of a packet. It is stores routes to network destinations and contains the topology of the network. Routing protocols and static routes help calculate the routing table.
netstat -nrPrint Active Connections
netstat -atnp | grep ESTAPrint network interfaces
network -iSlightly more readable
network -iePrint Statistics
netstat -sContinuous output
netstat -c