返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 + t7 U; ?5 K; C& i
   . j  b3 Q5 H( u7 k; j1 K% `
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
  R* m/ r( C# O  i7 ]   7 V, P7 K) v" M7 P( {  ^
  ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [[-j computer-list]   [-k computer-list]] [-w timeout] destination-list 2 {/ n3 i9 t* {, |
  
3 |7 T( a( `4 r- r  Options: $ D3 Q1 {6 L9 G. ^) @
  
/ N. |9 G. b" c6 D7 P1 c& L4 r. {  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 6 c. X" T8 j/ r1 r5 W
   & A5 P/ Z! Y, W5 b
  不停的ping地方主机,直到你按下Control-C。
" H* V& J# P1 V! f   ! l' g  \$ Z6 T6 _& m$ s6 f
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
; L) J: _7 F) ^4 M! G   , B  {$ X/ c! N# N3 Y7 ^
  -a Resolve addresses to hostnames.
8 ^/ L  c& R* d! o7 \* X( z3 [: g   ! C7 L% q: z1 p% y: \4 w+ z  U% I8 a
  解析计算机NetBios名。
- w+ @( u/ o" f: K" E$ Y  
$ ]6 t2 m% H' b& k2 {( E8 T* a* W  示例:C:\>ping -a 192.168.1.21
0 P' g2 Y# Q* T% i; P  
# @8 A+ o0 I8 [- P/ @3 D6 U  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
  M7 a! K2 A& l# I   : F7 y8 u4 s& c) x
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 F2 j; C6 |% ~' C4 `. t! q  
9 P/ L( o, V7 ^( ?4 `5 c  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , s+ R* D. l+ u( g7 V
   + d+ L' V; @; X2 h
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  O4 w5 _- k( Q: ^% U6 H* j& c, ?. c! T  j( I) Y
   7 \+ n6 ]' I( r
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# Z' J% H7 ^+ k, _8 d; j7 C* F( T  
* d$ A  v% o2 A5 P2 }  Ping statistics for 192.168.1.21:
, j% V. m. ~3 s   5 T' F0 ^5 X/ y2 P% A1 \
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 5 g# h# k; [% o7 \0 y4 A
  
9 W  q! h; S( N. S+ L3 T7 G, c  q  Minimum = 0ms, Maximum = 0ms, Average = 0ms & [1 \2 M% Z' U: \3 U* z
  
( j% R& D4 A- A! ^/ A  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
0 v5 v6 V9 A* K- e   3 L" Y* j' T2 u6 l! h
  -n count Number of echo requests to send. 4 m8 t( a0 L( o
  
0 z: k( q7 e8 h, M9 ~/ ]3 h  发送count指定的Echo数据包数。 ( \3 N+ J5 T( q2 E! Q
   9 `/ S6 E) L9 X* _
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:   D) z, k; S$ |: O7 P3 Z& r( T; b6 T
  
( C# A# B1 |9 _2 g; u, B4 u: m  C:\>ping -n 50 202.103.96.68
7 o2 _+ I# ^0 Q  
% [- D; F9 w2 k8 R  Pinging 202.103.96.68 with 32 bytes of data: ) t3 ~' i: V9 Z% F* l
   : R0 `1 H# @" j5 h. y1 U
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% W5 L, X0 _) l; W: E  
6 W6 t1 n; D4 C9 x% w  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( [+ N; j: o1 y$ ?/ V( J0 H: a
  
/ O2 _: _) a& z3 r6 O: Z9 w  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! A( n, o* P2 p
     V, ^* {# D1 u8 j
  Request timed out. - M8 ~3 v4 Z4 {: E+ O
  
3 b) |& c, }) r! N6 `& ?  ……………… 6 U* y2 Q& d7 F
   1 [5 J6 O) i  V# `' y7 V2 z$ O: L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* \; o7 K5 W% ]" b% w# k3 g   , s6 v: U/ ]/ j) i. C5 a* R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: y$ e: A, E; W: d  
* p* ^) k" v1 W0 D; y  Ping statistics for 202.103.96.68:
3 B* F9 }. ~! z/ X+ S8 y" g  
) m/ T: a$ f% w1 r  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
* {4 c. b  `5 u1 s- i8 u3 f* [6 W$ x* I! A) X   ' {* j0 O- o; N' S
  Minimum = 40ms, Maximum = 51ms, Average = 46ms # }) ?% [$ e! F# T* @, O' `
   $ D: r+ e3 K: ~& n; z  P! j
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。   a" E8 F9 ]# F% U9 z, D4 g2 e* a2 F
   ! T' @2 M# a; J. ~; t$ K
  -l size Send buffer size.
  u, m9 w, h3 U  k* C2 {  
: U' v! [8 N1 o, a4 Y3 @  定义echo数据包大小。
89w.org捌玖网络

强大,但是我看得不是很懂!

TOP

返回列表
【捌玖网络】已经运行: