Netstat is a single command, but it can be modified by options to produce different results. The command is not operating system-specific and so is available on Windows, Mac, Linux and Unix. Netstat reports on the current connections made on the computer through ports to remote computers over a network. The utility examines TCP/IP connections. For the home user, that means internet connections. TCP/IP connections can be made through a range of standard procedures, called “protocols.” The main two sets of protocols in TCP/IP are the Transmission Control Protocol and the User Datagram Protocol. Each has its own range of “ports.” This does not refer to the plug sockets on the computer, but a logical address used in network programming.
- Skill level:
- Moderately Easy
Other People Are Reading
Things you need
- Internet connection
Type netstat at the command prompt. The utility will return a table of data. The columns in the table are “Proto,” “Local Address,” Foreign Address” and “State.” Each row in the table represents a connection to your computer over the network (or Internet) that is either active or waiting.
Examine the “Proto” column. Most rows will have the value “TCP” which is a connection-oriented transfer protocol. If you have a multimedia or Internet telephony application running on your computer, you will see UDP connections. Netstat by itself will only show TCP connections.
Read through the “Local Address” values in each row. This has three elements: The recipient on the computer, the address of your computer and the port number. The computer’s address may appear either as an IP address or in hexadecimal format. The port number appears after a colon at the end of the address.
Scan down the “Foreign Address” column to see the addresses of the computers you are currently connected to. This address may be in IP format, a Web domain, or a hexadecimal number. The prot number is not always shown in this column. Instead, the space used for the port number after the colon at the end of the address could read “http,” or “https.”
Check the state of the connection. There are ten options: “ESTABLISHED,” “TIME_WAIT,” “CLOSE_WAIT,” “CLOSED,” “FIN_WAIT_1,” “FIN_WAIT_2,” “LAST_ACK,” “LISTEN,” “SYN_RECEIVED” and “SYN_SEND.” Most of the entries will either say “ESTABLISHED” or “LISTEN.” A listening connection indicates a daemon which is a program on your computer that runs constantly waiting for incoming messages.
Modify the command with “switches.” These are options that follow the command and start with a minus sign (“-“). Adding “-a” to the end of the command will show all active TCP and UDP connections. The “-n” switch shows TCP connections with the addresses expressed as IP addresses only. Each operating system has a different list of switches. To get a full list for your system type netstat ?.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for