返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
2 ]2 b, j0 i& p   6 T7 v2 w1 Y; O! m6 I1 b/ n1 ?
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 5 _2 E/ r1 a3 m/ A: ?
   " y) {) E  B% a8 z( j0 U, q; F9 s" v" ?
  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   Z& L- D8 j( D& d$ m
  
5 h- d* p" D" |1 K' ^( r  Options: ; g, ]7 \; c2 {3 R8 |' e6 N
  
" c( N  j) q! C+ L  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
7 S" @' V! I) O; F4 K0 w* I( t  
2 x; U$ d6 f1 L0 o. [  不停的ping地方主机,直到你按下Control-C。 " e$ \$ p( \( G. p8 ]
   5 {5 c; S" r6 P+ A
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * o' W; M8 N  b8 r  I
  
$ l5 n: F7 g" M  -a Resolve addresses to hostnames.
. M* |' d$ G% n6 U3 p1 p   0 K+ o8 k4 L% l; @
  解析计算机NetBios名。 % G, b5 n" e5 P0 x
  
- v, l& {1 k* D$ ^3 I- t  示例:C:\>ping -a 192.168.1.21 1 `# Q% }' y5 M5 u
   5 W& ?- V& M+ F$ p( c) }6 w, H
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: * [. S/ g" h! |
     l% S+ j0 G: o. _
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! ?9 a- g/ R- E2 Q% s* J
   7 u/ Z3 Y1 I% `9 v: e
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & j/ E6 I& U7 R3 X, K% z0 B; c% h& L
   # `# n' b9 s6 t$ ?
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 w& i7 {% K; R8 F
; R% _$ p6 p3 S% U( l   / e2 L- o" G: c  e
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / w0 U" |! j  @/ z( a5 T7 I
  
2 q" C: D+ r# t4 w; K  Ping statistics for 192.168.1.21:
. q, E' P6 p6 ~: C8 b  
  l" Y/ H1 S4 ?' ]7 ?* m  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
* F/ D: L/ I3 y# V  
- O% `! i" g* ~) Q  Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 W/ t  z" @/ `) u' }2 D$ R
   , U$ H" d6 [* L& V
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 2 ^' i. K1 L' K
  
7 c' N, G& a/ i* _$ Z% I0 t  -n count Number of echo requests to send.
/ F' e% F" n4 G  
. }, K* ]* o+ ?% P# y) p, l  发送count指定的Echo数据包数。
: y  z, ~' }& ?+ n' H   , ?# z$ ?, L8 Z
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: & i: d3 u! B* a4 w) w5 v! R9 h
  
2 b' f( m" w9 P& j2 o7 ?  C:\>ping -n 50 202.103.96.68 9 Q0 q. ^" ?3 r& y
  
/ x8 E2 j. ?8 a4 `, c; R% ~  Pinging 202.103.96.68 with 32 bytes of data: 7 T( s" g+ w% x7 G' V* v
   2 F- s& P' g/ R6 x8 ]* X; w
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 X7 k( H. k) D9 p5 S( o( U9 i
  
, d2 Z+ ^" e/ C" w1 U& n6 }# o3 V  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 T4 R* H  D: g4 }6 u
  
: c: H/ @- ?. L/ K! Y: C, A: R  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 ~- ]- p3 g- r! ^' D
   ' ^( C. S- J* F& V. e4 f% y5 ]
  Request timed out.
! j% u2 M) Y. l+ y; G# l   6 v" N9 Y3 w0 w+ h! `, @
  ……………… ' i! K5 ~3 R, l' l
  
) Q! [  }! x1 N8 z8 i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 a8 u+ v! v7 f4 S: b   " [) u7 L1 M9 J5 ~5 J% W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . T* s- u: B& _6 @, E
   # H/ i- g' x! z9 z) @5 h$ x! \
  Ping statistics for 202.103.96.68: " Z) l% w) \6 j. O) w, K
  
1 m9 Z$ a4 S) u3 |5 a2 m; l  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
6 o2 B5 H2 E6 X) R7 F   6 P9 p0 r7 o6 m  C. ?. R2 P1 k
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ' V4 m  K: y9 ^' a9 V
   , Y9 x- b8 t$ N$ f/ X9 {! V
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 " \* Z8 D3 m- ]7 J9 r1 n
  
; `5 A5 e. |! R  x" Z/ ~1 w3 ^  -l size Send buffer size.
6 i  `5 e' u- _$ b5 F6 e+ ]3 ~   9 z' @2 S+ x! X: N& n3 d; e) J5 c
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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