The “netstat” command is included with most TCP/IP-enabled operating systems. Little understood and infrequently used, netstat is a great tool for troubleshooting connectivity issues related to IP address and port configuration.
Netstat displays protocol statistics and current TCP/IP network connections. Use it with any of several switches to display all connections and listening ports, Ethernet statistics, the routing table, and per-protocol statistics. For UNIX and Linux users, there are even more options available.
Run netstat at a command prompt using the following syntax to see the various options available:
A commonly used command is “c:>netstat -an” which displays all connections and listening ports in numerical form. By default, the output is displayed on your screen, but you can direct the output to a file by using the following syntax: “c:>netstat -an > netstat.txt”. That sends a list of all connections and listening ports to the file netstat.txt which can be found in the current directory.
Want to know more about netstat and other troubleshooting tools? Schedule our Networking Fundamentals 2-Day Hands-On Workshop for your location. Remember, onsite training makes sense for groups of four or more.