Netstat命令
Netstat的一些常用选项
netstat -s——本选项能够按照各个协议分别显示其统计数据。如果你的应用程序(如Web浏览器)运行速度比较慢,或者不能显示Web页之类的数据,那么你就可以用本选项来查看一下所显示的信息。你需要仔细查看统计数据的各行,找到出错的关键字,进而确定问题所在。
看最大连接数 Current Connections
-s 参数的作用前面有详细的说明,来看例子
C:\>netstat -s
IPv4 Statistics (IP统计结果)
Packets Received = 369492(接收包数)
Received Header Errors = 0(接收头错误数)
Received Address Errors = 2(接收地址错误数)
Datagrams Forwarded = 0(数据报递送数)
Unknown Protocols Received = 0(未知协议接收数)
Received Packets Discarded = 4203(接收后丢弃的包数)
Received Packets Delivered = 365287(接收后转交的包数)
Output Requests = 369066(请求数)
Routing Discards = 0(路由丢弃数 )
Discarded Output Packets = 2172(包丢弃数)
Output Packet No Route = 0(不路由的请求包)
Reassembly Required = 0(重组的请求数)
Reassembly Successful = 0(重组成功数)
Reassembly Failures = 0(重组失败数)
Datagrams Successfully Fragmented = 0(分片成功的数据报数)
Datagrams Failing Fragmentation = 0(分片失败的数据报数)
Fragments Created = 0(分片建立数)
Received Header Errors = 0(接收头错误数)
Received Address Errors = 2(接收地址错误数)
Datagrams Forwarded = 0(数据报递送数)
Unknown Protocols Received = 0(未知协议接收数)
Received Packets Discarded = 4203(接收后丢弃的包数)
Received Packets Delivered = 365287(接收后转交的包数)
Output Requests = 369066(请求数)
Routing Discards = 0(路由丢弃数 )
Discarded Output Packets = 2172(包丢弃数)
Output Packet No Route = 0(不路由的请求包)
Reassembly Required = 0(重组的请求数)
Reassembly Successful = 0(重组成功数)
Reassembly Failures = 0(重组失败数)
Datagrams Successfully Fragmented = 0(分片成功的数据报数)
Datagrams Failing Fragmentation = 0(分片失败的数据报数)
Fragments Created = 0(分片建立数)
ICMPv4 Statistics (ICMP统计结果)包括Received和Sent两种状态
Received Sent
Messages 285 784(消息数)
Errors 0 0(错误数)
Destination Unreachable 53 548(无法到达主机数目)
Time Exceeded 0 0(超时数目)
Parameter Problems 0 0(参数错误)
Source Quenches 0 0(源夭折数)
Redirects 0 0(重定向数)
Echos 25 211(回应数)
Echo Replies 207 25(回复回应数)
Timestamps 0 0(时间戳数)
Timestamp Replies 0 0(时间戳回复数)
Address Masks 0 0(地址掩码数)
Address Mask Replies 0 0(地址掩码回复数)
Messages 285 784(消息数)
Errors 0 0(错误数)
Destination Unreachable 53 548(无法到达主机数目)
Time Exceeded 0 0(超时数目)
Parameter Problems 0 0(参数错误)
Source Quenches 0 0(源夭折数)
Redirects 0 0(重定向数)
Echos 25 211(回应数)
Echo Replies 207 25(回复回应数)
Timestamps 0 0(时间戳数)
Timestamp Replies 0 0(时间戳回复数)
Address Masks 0 0(地址掩码数)
Address Mask Replies 0 0(地址掩码回复数)
TCP Statistics for IPv4(TCP统计结果)
Active Opens = 5217(主动打开数)
Passive Opens = 80(被动打开数)
Failed Connection Attempts = 2944(连接失败尝试数)
Reset Connections = 529(复位连接数)
Current Connections = 9(当前连接数目)
Segments Received = 350143(当前已接收的报文数)
Segments Sent = 347561(当前已发送的报文数)
Segments Retransmitted = 6108(被重传的报文数目)
Passive Opens = 80(被动打开数)
Failed Connection Attempts = 2944(连接失败尝试数)
Reset Connections = 529(复位连接数)
Current Connections = 9(当前连接数目)
Segments Received = 350143(当前已接收的报文数)
Segments Sent = 347561(当前已发送的报文数)
Segments Retransmitted = 6108(被重传的报文数目)
UDP Statistics for IPv4(UDP统计结果)
Datagrams Received = 14309(接收的数据包)
No Ports = 1360(无端口数)
Receive Errors = 0(接收错误数)
Datagrams Sent = 14524(数据包发送数)
No Ports = 1360(无端口数)
Receive Errors = 0(接收错误数)
Datagrams Sent = 14524(数据包发送数)
netstat -e——本选项用于显示关于以太网的统计数据。它列出的项目包括传送的数据报的总字节数、错误数、删除数、数据报的数量和广播的数量。这些统计数据既有发送的数据报数量,也有接收的数据报数量。这个选项可以用来统计一些基本的网络流量。
netstat -r——本选项可以显示关于路由表的信息,类似于后面所讲使用route print命令时看到的 信息。除了显示有效路由外,还显示当前有效的连接。
netstat -a——本选项显示一个所有的有效连接信息列表,包括已建立的连接(ESTABLISHED),也包括监听连接请求(LISTENING)的那些连接,断开连接(CLOSE_WAIT)或者处于联机等待状态的(TIME_WAIT)等
netstat -n——显示所有已建立的有效连接。
学习地址: