The NETSTAT utility is a command available on most platforms that enables a user to list the sockets in use on a system. The information returned by the command is only for the local host, and there is no provision for monitoring remote hosts using this utility.
The most common uses for NETSTAT are:
_ Determining how many sockets are currently open on a system
_ Determining what application owns a particular socket
_ Diagnosing TCP/IP problems
_ Diagnosing routing problems
The NETSTAT command can be issued with or without parameters. Without parameters, the output generated by the command typically lists all of the active UDP and TCP connections in the system’s connection table. Options can be added to filter the output, …show more content…
Conn The connection identification number.
650 TCP/IP Tutorial and Technical Overview
Local Socket The local IP address and port over which the connection is active.
Foreign Socket The remote IP address and port over which the connection is active.
State The state of the connection. Most implementations use some form of the following values for state:
• CloseWait
• Closed
• Established
• FinWait_1
• FinWait_2
• LastAck
• Listen
• SynReceived
• SynSent
• TimeWait
• …show more content…
Example 2 Sample routing table
:\> NETSTAT -r
TCPIP Name: TCPIP 13:25:04
Destination Gateway Flags Refcnt Interface
----------- ------- ----- ------ ---------
Default 10.44.36.129 UGS 001504 INTRF1
Default 10.44.36.129 UGS 000006 INTRF2
10.44.36.128 0.0.0.0 US 000003 INTRF1
10.44.36.128 0.0.0.0 US 000000 INTRF2
10.44.36.129 0.0.0.0 UHS 000000 INTRF1
10.44.36.129 0.0.0.0 UHS 000000 INTRF2
10.44.36.163 0.0.0.0 UH 000000 VIPAL1
10.44.36.164 0.0.0.0 UH 000000 INTRF1
10.44.36.165 0.0.0.0 UH 000000 INTRF2
127.0.0.1 0.0.0.0 UH 000002 LOOPBACK
Again, the columns above are defined as follows:
Destination The route described by the report.
Gateway The gateway (if any) used to reach this route.
Flags Attributes of the route. Possible values include:
• G: The route uses a gateway.
• U: The interface over which the route travels is up.
• H: Only a single host can be reached through this route.
• D: The route was dynamically created.
• M: The route’s table entry was modified by an ICMP redirect message.
• !: The route is a reject route; datagrams will be dropped.
Refcnt The number of connections using this route.
Interface The interface used by the