Secrets of netstat usage

1. What is netstat.exe?

Netstat.exe is a command-line tool that gives you the list of all TCP and UDP connections, network statistics and the IP routing table.

2. Where I can download it?

Netstat is a built-in Windows tool. To run it, click the Start button. Click “Run” and type “cmd” in the run box. A command prompt window will be shown. Type “netstat” in the command window.
Without arguments the program prints established connections on your computer.

3. How to see all connections?

Use “netstat -a” to see all connections, including those in the state different from ESTABLISHED.

4. Who is using a port?

By default, netstat shows what the program is using a port. To show this information you must add the option “-b”. For example:
“netstat –a –b” shows all connections and includes the process name for each connection.

With “-o”, netstat shows only the process PID. The option “-v” allows you to see components used by a program.
These options are available only on Windows XP, 2003 Server and high.

5. How to show network statistics?

Use “-s” parameter to display protocol statistics. You can combine it with option “-p” to specify the protocol. For example:
“netstat -s -p IP” prints IP protocol statistics.
The command “netstat -e” shows your interface statistics. It shows how many bytes sent or received by your computer.

6. How to view IP routes on my computer?

“netstat -r” command shows the list of network interfaces and the IP routing table. You may use “route print” also.

7. Can it work faster?

Sometime netstat prints connections very slowly, because the program tries to determine hostname of each remote IP address. For quick view, use “netstat -n” command. This command shows all addresses and ports as numbers.

8. How to filter the information?

You can filter netstat output with command “findstr”. For example:
“netstat –a –n | findstr :80” prints all connections with port 80.

9. How to save netstat output?

Yes, you can save the information to file with option “> [path]”:
“netstat –a –n > C:\log.txt”

10. Can the program show connections every 10 seconds?

The program redisplays the information each specified interval (in seconds):
“netstat –n –p TCP 10” shows TCP connections every 10 seconds.
Press CTRL+C to stop redisplaying the information.

NetStat Agent is the replacement of netstat.exe command line tool, but in more handy and easy-to-use graphical interface. It has a lot of powerful features.