Displaying connection statistics with netstat
The netstat
command is a useful utility to allow you to view some statistics regarding your current connection. We touched on it a bit in the last chapter. This command allows you to show useful networking information, such as showing you services that are listening for connections on your network card, and printing your routing table, among other things.
In the last chapter, I gave the example of netstat -tulpn
to allow you to view currently connected and listening services. This command shows everything that's listening, as well as the port that it's listening on. Breaking this command down, we passed along some parameters. The first, -t
, identifies that we would like to view information pertaining to TCP, -u
represents UDP, -l
requests listening sockets, -p
attempts to show the name of the program, and -n
also shows numeric values. Putting it all together, we get netstat -tulpn
. In the industry, this is the most common usage of netstat
that...