• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 4. Windows XP Applications and Tools > Active Connections Utility

Active Connections Utility \windows\system32\netstat.exe

Displays protocol statistics and current TCP/IP network connections.

To Open

Command Prompt netstat

Usage

netstat [-a] [-e] [-n] [-o] [-p proto] [-r] [-s] [interval]

Description

Type netstat by itself to list the active incoming and outgoing network connections. This can be useful, for example, to determine exactly what is being transmitted or received across the network at any given time.

The Active Connections Utility accepts these options:


-a

Display all connections and open ports (see Notes).


-e

Display Ethernet statistics; it can be combined with -s.


-n

Display addresses and ports in a numerical format (e.g., 192.168.0.1:88).


-o

Display the process that owns each listed connection.


-p proto

Show the connections corresponding to the protocol; the protocol can be IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.


-r

Display the routing table (see “Route”, later in this chapter).


-s

Display statistics for each protocol. By default, statistics are shown for all protocols, but this display can be filtered with the -p option.


interval

Repeatedly run netstat, pausing interval seconds between each display. Press Ctrl-C to stop the display at any time. If omitted, netstat will display the current statistics once and then quit.

Information is displayed in the following columns:


Proto

The protocol—usually TCP for the TCP/IP protocol used on the Internet and most local networks


Local Address

The name of the local machine, followed by a colon, and then the process ID of the application that has initiated the connection


Foreign Address

The name or IP address of the remote machine, followed by a colon, and then the port number


State

Shows whether the connection is established or broken

Notes

  • You must have an open command prompt window to use netstat; otherwise, the window closes before you can read the program’s output.

  • The the -a parameter is especially useful, as it lists all currently open ports. Open ports can sometimes compromise security, so it’s best to know about any back doors. See Chapter 7 for more information.

  • Type netstat /? at the command prompt for a description of the command-line options.

See Also

“OpenFiles”

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint