NETSTAT Windows Command Guide
The Windows netstat command is a versatile tool for displaying active network connections, routing tables, interface statistics, and other important networking information. By running netstat in the command prompt, users can quickly identify established TCP connections, view listening ports, check network interface details, and troubleshoot network-related issues. This handy command provides vital insights into a system’s network activity, making it an essential tool for network administrators, IT professionals, and anyone looking to understand and optimize their network connections on a Windows operating system.
NETSTAT Syntax:
Options:
Option | Description |
---|---|
-a | Displays all connections and listening ports. |
-b | Displays the executable involved in creating each connection or listening port. |
-e | Displays Ethernet statistics. |
-f | Displays Fully Qualified Domain Names (FQDN) for foreign addresses. |
-n | Displays addresses and port numbers in numerical form. |
-o | Displays the owning process ID associated with each connection. |
-p | Shows connections for the specified protocol. |
-r | Displays the contents of the routing table. |
-s | Displays per-protocol statistics. |
-t | Displays the current connection offload state. |
Parameters:
Parameter | Description |
---|---|
protocol | Specifies the protocol to display. Can be TCP, UDP, TCPv6, or UDPv6. |
interval | Redisplays the output every “interval” seconds. |
NETSTAT Command Samples:
Display All Active Network Connections
Displays all active network connections and listening ports.
Display Active TCP Connections
Displays all active TCP connections and listening ports.
Display Active UDP Connections
Displays all active UDP connections.
Display PID and Process Name for Active Connections
Displays the PID and process name for each active connection.
Display Statistics for Network Interfaces
Displays statistics for network interfaces, including packets and bytes sent and received.
Display Active Connections in Numerical Form
Displays active connections in numerical form (IP addresses and port numbers).
Display Routing Table
Displays the routing table, including destination, gateway, and interface information.
NETSTAT FAQ:
How do I use netstat in Windows?
To use the netstat command in Windows, execute the following command:
What is the purpose of netstat in Windows?
The netstat command in Windows is used to display active TCP connections, listening ports, and related network statistics.
How can I display all active TCP connections using netstat?
To display all active TCP connections, run the following command:
How do I list all listening ports with netstat in Windows?
To list all listening ports, use the following netstat command:
How can I find the PID (Process ID) associated with a specific network connection using netstat?
To find the PID associated with a network connection, you can execute:
How can I filter the netstat output to only display specific protocol connections, such as TCP or UDP?
To filter the netstat output by protocol (TCP or UDP), you can use:
Applications of the NETSTAT Command
- Displaying active network connections
- Listing listening ports
- Showing network statistics
- Displaying the routing table