Local port enumeration – what am I connected to? What am I listening for?
Many fundamental troubleshooting steps in networking are at one end or the other of a communication link – namely on the client or server host. For instance, if a web server isn't reachable, it's of course useful to see whether the web server process is running and is "listening" on the appropriate ports for client requests.
The netstat
command is the traditional method to assess the state of network conversations and services on the local host. To list all listening ports and connections, use the following options:
All five parameters are illustrated as follows:
$ netstat –tuan Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp ...