返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 " A/ d# r- }* J3 R; b
  
9 c2 v% m. J+ I  r% O, l  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
+ M" g- R1 C# j. q- o7 u   3 e' O! ^. a. P! M' R2 ]. i
  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
; w) M/ M" H/ B  
  @9 f% q. l& v  Options: # Z/ K5 w7 T- }7 ]/ W( T% F
   / D6 t6 K# K# g  R
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
9 H* K9 ^- s8 q& j- a   : U8 e3 C) L5 r. H* z; g7 z8 _1 u
  不停的ping地方主机,直到你按下Control-C。
0 r" j6 m) x  |6 i  
  m6 w2 k6 }1 @& I7 h, B' z* r; R  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * |; U( ]- f' ?7 |8 N) t
  
; A2 \+ h7 V$ i9 }: }& ]  -a Resolve addresses to hostnames.
6 D" G! u. L& u) \8 @' j   " j: V! j% m4 x  ~5 h
  解析计算机NetBios名。 $ T! a" a  j4 d8 i6 j8 J7 i$ N
  
3 }& W! n8 R' j, P  示例:C:\>ping -a 192.168.1.21 " Y8 L/ X4 R+ s& x0 j
  
1 Y. n$ f9 m7 I2 n! y( E  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 @- J6 m- j( V) r/ A$ z$ {   3 W1 t1 n3 u9 _, l% X
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 H4 e3 B/ d3 i  m+ _$ t
  
$ l/ _2 d! ^' K( Y/ s& w) H+ w) s. C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! m; p1 h7 h/ q$ H. H+ C! n
  
. Z6 l& S3 O/ H! A$ C8 z* C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 a. V3 m9 i( N
- W$ F- s& V5 p2 l$ D  
6 h( s1 Y7 `2 z9 B  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- A" `3 _7 W9 }4 A  T  
4 d0 a- E5 O. J8 q  Ping statistics for 192.168.1.21:
4 x) j" B: ^) ]$ v: z   ; y/ M5 \" @8 w
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: / i1 P8 W% X" \8 P
   * f3 @0 n% Q; i* T" s* f5 x
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 h/ g5 @: x1 C' B1 B. ^
   . m% t# V5 q& N8 v) H
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。   g4 E4 d7 p6 I. O2 @- A# z
   ) v8 j4 N% Q2 ?* ~
  -n count Number of echo requests to send.
' a# [3 u; E9 _" \7 V  
; m7 y; k) o+ o1 M! ^/ n  发送count指定的Echo数据包数。
9 o4 r. }1 f1 y  
+ V: w( ?- a, n! o' v  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
# t" J) b3 G2 }, k" ^# v0 O% I* g   9 [, q" v, L# L! f3 E
  C:\>ping -n 50 202.103.96.68 9 H) _* n. s  h: T% R: ^& Q
  
/ R, H2 M0 [( V$ [! }+ i/ r" Z  Pinging 202.103.96.68 with 32 bytes of data:   z% Z" D0 y( y# K, G0 o, P- y! ?9 [
  
1 E5 K$ u* K9 j# q9 U" C3 o  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 ~& ]5 ^: d3 U5 a: N# o
  
1 t- `, u3 T2 A3 k- D3 k6 y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 G& w9 W: }2 I   ; _9 |4 j  E# W' o7 H; B- L  M- R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# F1 x* v) Y8 f7 Q* [( E   ' ?, ^( p# f9 X2 o, ^& K* [
  Request timed out. - Z: ^$ {# h. a
  
2 K, @, @2 l) s! t/ `  ……………… ' M( N& y$ N+ ?+ o! Z) v: E
  
. G& p$ f. g4 b; B; o5 T4 z' q# c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 h2 t! l& ~( ?* b* N
  
) T: w( ?& G" R& M  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. v; M+ H- t! G9 T+ a* O& O2 [8 Y  
$ Y. h" r, ]& W" |0 ~: ^; ?  Ping statistics for 202.103.96.68:
. W! b3 w8 L- u0 O1 F. @  
8 i  _: n6 s& S! \8 j9 E  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 5 R3 Z, w$ Z7 j7 Y7 f: o& W& |
  
5 W1 o6 D6 {6 X8 G8 L! G) ~3 Q9 K  Minimum = 40ms, Maximum = 51ms, Average = 46ms
0 s, l  A( g0 L' U7 F. h7 F  
$ V- i2 l4 E( I4 `: n) P3 e  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 + j' Z/ k7 k  S; }, v$ i7 S
  
8 N+ a: }( R+ j6 P5 R$ n  -l size Send buffer size.
* @7 H) J9 x6 f9 a8 f% U   + G6 _! }, i. P! g6 `2 ?
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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