Я думаю, что вы можете получить что-то вроде результата команды netstat -s
.
Это покажет вам статистику, как это:
IPv4 Statistics
Packets Received = 125858
Received Header Errors = 0
Received Address Errors = 130
Datagrams Forwarded = 0
Unknown Protocols Received = 0
Received Packets Discarded = 315
Received Packets Delivered = 126500
Output Requests = 83395
Routing Discards = 0
Discarded Output Packets = 0
Output Packet No Route = 1
Reassembly Required = 0
Reassembly Successful = 0
Reassembly Failures = 0
Datagrams Successfully Fragmented = 0
Datagrams Failing Fragmentation = 0
Fragments Created = 0
IPv6 Statistics
Packets Received = 7
Received Header Errors = 0
Received Address Errors = 0
Datagrams Forwarded = 0
Unknown Protocols Received = 0
Received Packets Discarded = 2
Received Packets Delivered = 117
Output Requests = 444
Routing Discards = 0
Discarded Output Packets = 0
Output Packet No Route = 6
Reassembly Required = 0
Reassembly Successful = 0
Reassembly Failures = 0
Datagrams Successfully Fragmented = 0
Datagrams Failing Fragmentation = 0
Fragments Created = 0
ICMPv4 Statistics
Received Sent
Messages 241 2
Errors 0 0
Destination Unreachable 241 2
Time Exceeded 0 0
Parameter Problems 0 0
Source Quenches 0 0
Redirects 0 0
Echo Replies 0 0
Echos 0 0
Timestamps 0 0
Timestamp Replies 0 0
Address Masks 0 0
Address Mask Replies 0 0
Router Solicitations 0 0
Router Advertisements 0 0
ICMPv6 Statistics
Received Sent
Messages 3 18
Errors 0 0
Destination Unreachable 0 0
Packet Too Big 0 0
Time Exceeded 0 0
Parameter Problems 0 0
Echos 0 0
Echo Replies 0 0
MLD Queries 0 0
MLD Reports 0 0
MLD Dones 0 0
Router Solicitations 0 12
Router Advertisements 0 0
Neighbor Solicitations 0 3
Neighbor Advertisements 3 3
Redirects 0 0
Router Renumberings 0 0
TCP Statistics for IPv4
Active Opens = 1232
Passive Opens = 4
Failed Connection Attempts = 1647
Reset Connections = 121
Current Connections = 28
Segments Received = 104462
Segments Sent = 66346
Segments Retransmitted = 1695
TCP Statistics for IPv6
Active Opens = 0
Passive Opens = 0
Failed Connection Attempts = 0
Reset Connections = 0
Current Connections = 0
Segments Received = 0
Segments Sent = 0
Segments Retransmitted = 0
UDP Statistics for IPv4
Datagrams Received = 26472
No Ports = 297
Receive Errors = 18
Datagrams Sent = 15279
UDP Statistics for IPv6
Datagrams Received = 2
No Ports = 0
Receive Errors = 2
Datagrams Sent = 338
Или, если вы хотите получить статистику уровня 2, вы можете использовать netstat -e
чтобы получить только те данные, которые связаны с Ethernet:
Interface Statistics
Received Sent
Bytes 604513390 48753903
Unicast packets 566790 389160
Non-unicast packets 81665 5275
Discards 0 0
Errors 0 0
Unknown protocols 0