netstat command (Network statistics)
Description
The "netstat" command allows to monitor network connections, network packets statistic for each protocol, to display routing tables and statistics for network interfaces.
Syntax:
Parameters
-r
Displays the content of the system routing tables.
Flags for specific routes have the following meaning:
"U" – this routing table element is currently active.
"H" – this route leads to a host. If this flag is not set, the route goes to a network.
"D" – this route has been created using the "icmp redirect" protocol.
"M" – this route has been modified using the "icmp redirect" protocol.
"G" – this route is connected to a host. If this flag is not set, it is considered that the route destination is directly connected.
"S" – it's a static route, set by the operator using a "route add" command.
"1" – a pseudostatic route, set as a result of a "rip static" command.
"L" – a route points to a directly connected host (for such a route an APR request may be performed).
"C" – when using this route, more specific routes may be created (e.g. using the "L" flag).
-i [clear]
Displays an information about each network interface in the system.
"clear" – resets a statistic of inbound / outbound packets and errors.
-s{rut}
Displays statistics for IP and ICMP packets.
"r" – if added, statistic of RAW protocol packets is displayed.
"u" – statistic of UDP protocol packets is displayed.
"t" – statistic of TCP protocol packets is displayed.
Examples
Display the content of the system routing tables using the "-r" parameter.
Reset the statistic of packets and display the information about network interfaces using the "netstat -i [clear]" command.
Use the "-s" parameter to display packet statistic.
Display statistic of UDP protocol packets using the "netstat -su" command.
Last updated