Table of Contents
Checking Your Network
The netstat command
netstat is a useful tool for checking your configuration and activity. It is in fact a collection of several tools lumped together. We present each of its functions in the following sections. More detail is to be found in [5],
Displaying the routing table
When you invoke netstat
with the -r
flag, it displays the kernel routing table in the way we've been doing with route. Try:
<cli>
icct@myhost:~$ netstat -r
</cli>
on your host, and make a note of the results.
Displaying interface statistics
When invoked with the -i
flag, netstat
displays statistics for the network interfaces currently configured. Try:
<cli>
icct@myhost:~$ netstat -i
</cli>
on your host, and make a note of the results.
Displaying connections
netstat
supports a set of options to display active or passive sockets. The options -t
, -u
, -w
, and -x
show active TCP, UDP, RAW, and Unix socket connections. If you provide the -a in addition, sockets that are waiting for a connection are displayed as well. This display will give you a list of all servers that are currently running on your system. Try:
<cli>
icct@myhost:~$ netstat -ta
</cli>
on your host, and make a note of the results.