The general format of this command is:
Netstat[ options]
The meanings of the options in the command are as follows:
-a shows all sockets, including those that are listening.
-c will be displayed again every 1 second until the user interrupts it.
-i Displays the information of all network interfaces in the same format as "ifconfig -e".
-n Replace the name with the network IP address to show the network connection.
-r displays the core routing table in the same format as "route -e".
-t shows the connection of TCP protocol.
-u shows the connection of UDP protocol.
-v shows the work in progress.
-A displays the address of any related protocol control block. Mainly used for debugging.
-a shows the status of all outlets. Typically, sockets associated with server processes are not displayed.
-i Displays the status of the automatic configuration interface. Interface states configured after initial system boot are not included in the output.
-m Print the usage of network storage.
-n Prints the actual address, rather than the explanation or display symbols of the address, such as host and network names.
-r print routing table
-f address -family prints statistics and control block information of a given address cluster. So far, the only supported address cluster is inet.
-I interface prints only the interface status of the given name.
-p protocol-name only prints statistics and protocol control block information of a given protocol.
-s prints statistics for each protocol.
-t Replace queue length information with time information in the output display.
Column header of netstat command
Name the name of the interface.
Maximum transmission unit of Mtu interface
Net/Dest interface in network.
Address IP address of the interface.
Number of packets received by Ipkts
The number of corrupted packets received by Ierrs.
Number of packets sent by o opkt
The number of corrupted packets when sending Oeers.
The number of network conflicts recorded by this interface.
Some common options for netstat:
Netstat-s-This option can display its statistics according to each protocol. If your application (such as a Web browser) is slow or data (such as a web page) cannot be displayed, you can use this option to check the displayed information. You need to look carefully at the lines of statistical data, find the wrong keywords, and then determine the problem.
Netstat-e-This option is used to display statistical information about Ethernet. It lists items including the total number of bytes, errors, deletions, datagrams and broadcasts of transmitted datagrams. These statistics include the number of datagrams sent and the number of datagrams received. This option can be used to calculate some basic network traffic).
Netstat -r-This option can display information about the routing table, similar to the information you will see later when using the routeproint command. In addition to displaying valid routes, it also displays currently valid connections.
Netstat-a-This option displays a list of all valid connection information, including established connections and connections listening for connection requests.
Bnetstat -n-displays all valid connections established.
0? 0 AWKPHP classic? 0? The meaning of state in 3netstat -an
Meaning of state in netstat -an
Listening: Listening for connection requests from remote TCP ports.
SYN-SENT: Wait for the matching connection request after sending the connection request again.
SYN-RECEIVED: After receiving and sending another connection request, wait for the other party to confirm the connection request.
ESTABLISHED: indicates an open connection.
FIN-WAIT- 1: Wait for the confirmation of remote TCP connection interrupt request or previous connection interrupt request.
FIN-WAIT-2: Wait for the connection interrupt request from remote TCP.
CLOSE-WAIT: Wait for the local user's connection interruption request.
Close: Wait for remote TCP to confirm that the connection is disconnected.
LAST-ACK: Wait for the confirmation of the original connection interruption request sent to remote TCP.
TIME-WAIT: Wait enough time to ensure that the remote TCP receives the confirmation of the connection interruption request.
Off: No connection status.