netstat, short for network statistics, is a command for displaying network information on the local node. The most common use of netstat is to display the route table:

[root@lefty /root]# netstat -r 
Kernel IP routing table 
Destination     Gateway       Genmask         Flags MSS Window irtt Iface 
lefty           *    UH      0 0         0 eth0     *      U       0 0         0 eth0       *          U       0 0         0 lo 
default         UG      0 0         0 eth0 

There is much more to netstat than simply printing the routing table. In fact, most of netstat’s output shows network connections on the local node.


The -a, or “all” parameter tells netstat to print all open sockets on the local node. This includes any connections initiated from the local node or daemons ...

Get Linux® Routing now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.