How to Use Netstat Commands

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.

How to Use Netstat Commands. Netstat is a utility that you can use to display your computer's connections to the Internet. It's a useful tool for monitoring connections and diagnosing problems. You can tweak netstat commands by adding arguments at the end of the command. Since netstat is run from a command prompt, it doesn't require you to install special software.

Advertisement

Step 1

Close all open programs on your computer. Click the start button. Click "Run." Type the word "cmd" in the run box. This will display a command prompt.

Video of the Day

Step 2

Type in "netstat" at the command prompt, followed by the argument that you want to use. For a list of all netstat arguments, type "netstat /?."

Advertisement

Step 3

Use "netstat -a" to get a list of all open network and Internet connections. To see IP addresses rather than names, use the "-an" argument.

Step 4

Specify which type of protocols are in use. Type "netstat -p TCP" to show only TCP connections. Type "netstat -p UDP" to show UDP traffic.

Advertisement

Step 5

Enter "netstat interval 10" to have netstat information displayed every 10 seconds. Replace the 10 with any number you want to use. To stop, press "ctrl" and "c" at the same time.

Advertisement

Step 6

Create a file by typing ">" followed by the file location and name of the text file after your netstat command. For example, "netstat -a >c:\log.txt" will create a file called log.txt on the C drive. The file will contain the netstat results. Open the file with Windows notepad.

Advertisement

Step 7

Check out active routes by typing "netstat -r." This displays your routing tables, including destination address, net mask and gateway.

Video of the Day

Advertisement

Advertisement