You may use netstat command to troubleshoot network problems for systems or applications in daily life. However, do you have a full picture of this command? In this post on MiniTool Website, we will walk you through the definition, parameters, and utilities of Windows netstat command.

What Is Netstat Command Windows?

Netstat stands for network statistics and netstat command refers to a command-line tool that shows your routing tables, network connections and other network interface information. You can make use of this command to identify security threats or troubleshoot problems on your server or computer.

Netstat command supports Command Prompt in most versions of Windows including Windows 11/10/8/7/Vista/XP and even older versions of Windows.

Parameters of Netstat Command

Netstat command Syntax: netstat [-a] [-b] [-e] [-f] [-o] [-p protocol] [-r] [-s] [-t] [-x] [-y] [time-interval] [/?]

-a: displays active TCP connections (with/without the listening state) and UDP ports that are being listened to.

-b: is similar to -o switch mentioned below. It displays the process’s actual name rather than the PID. Although you can save one or two steps using -b switch, it will take more time to execute.

-e: shows all the statics about your network connection including bytes, unicast packets, non-unicast packets, discards, errors and even unknown protocols that were received and sent since the connection was set up.

-f: forces the netstat command to show the FQDN (Fully Qualified Domain Name) for each foreign IP address as much as possible.

-n: prevents netstat from attempting to determine hostnames for foreign IP addresses. This switch can also considerably reduce the time to fully execute the process.

-o: displays the process identifier (PID) that is associated with each displayed connection. This switch is usually used in many troubleshooting tasks.

-p: shows connections or statistics only for a particular protocol. You can neither define more than one protocol at a time nor use -p switch without defining a protocol.

-s: is used with netstat command to show detailed statistics by protocol. You can also limit the statistics shown to a particular protocol by using the -s option and specifying that protocol. Make sure to use -s before -p protocol when using the two switches.

protocol: when specifying a protocol with -p switch, you can use TCP, UDP, TCPv6, or UDPv6. If you use -s switch and -p switch at the same time, you can also use ICMP, IP, ICMPv6 or IPv6 in addition to the four mentioned above.

-r: executes with netstat command to show the IP routing table. This is the same as using the route command to execute route print.

-t: shows the current TCP chimney offload state rather than the typically displayed TCP state.

-x: shows all NetworkDirect listeners, connections and shared endpoints.

-y: displays the TCP connection template for all connections and it cannot be used with other netstat commands.

/?: displays the details about the switches of netstat command.

time-internal: indicates the time that you hope to re-execute the command automatically. The process will stop until you use Ctrl + C.

How to Use Netstat Command in Windows?

Now, let me show you how does netstat command work in Windows.

Step 1. Press Win + S to evoke the search bar.

Step 2. Type cmd to locate Command Prompt and right-click on it to choose Run as administrator.

Step 3. Type netstat & hit Enter and then you will see a list of all active network connections.

run netstat

Proto: the network protocol like TCP, UDP and so on.

Local Address: the local computer’s IP address and the port number that you are using currently. An asterisk * means the port that hasn’t been assigned.

Foreign Address: the remote computer’s IP address and port number to which the socket is linked.

State: the status of the active TCP connection.

What Is Attrib Command & How to Use It in Windows 10/11?
What Is Attrib Command & How to Use It in Windows 10/11?

What is Windows 10 attrib command and what utilities does it have? If you are interested in that, investigate this command with us thoroughly in this article!

Read More

  • Linkedin
  • Reddit