获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
  {/ K% ^" n7 V8 r! h+ f# E  
2 B* B& ?5 ]& A: u+ H5 j  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
+ \. A; b8 K8 R( `" x" A* w   3 ^' d8 Y) G. b+ ]  j; N3 @9 Z
  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 _/ A" Z0 H2 _7 J4 X1 \
   4 p; |( Q8 ]0 U7 N9 e4 X* \2 C5 V( c
  Options: + J0 S( L8 z1 ~
  
9 D/ O$ p2 S0 L+ p9 m% w* Y  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.   A0 ?$ u6 S& ?& o' ]
  
- ^' E$ W2 M! r5 V( b4 ?6 l  不停的ping地方主机,直到你按下Control-C。
9 p4 c, T& q* U8 N4 f1 ]5 Z4 B! _' K# Y& }   , h) e$ ?( t9 T8 Q7 C
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
9 M' P2 Z7 C6 s   # K  T" ~; L  y2 z
  -a Resolve addresses to hostnames. 9 o* c5 p& ]) t0 e: [' F* D* }6 I
   - B" K/ i5 Z1 \& w* z5 L
  解析计算机NetBios名。 + R( P6 m( m+ k' N: V+ Q5 d
   7 B) t2 n! E, {5 C
  示例:C:\>ping -a 192.168.1.21
4 H- ~; B. _0 v3 O2 J# Z; S5 N* n/ D, Z  
* T- T' }) Y! I  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
/ g! a+ u# D( w9 O0 n# X/ x  
5 p5 [: j8 v4 u2 H& W2 A. M- J8 y( `  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 z) a8 {2 o) ^7 i  
& O( ]$ \0 S) m  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + `5 z3 {3 u1 l2 w9 W! n
  
" G: Z$ ^7 {/ p" d/ }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, Y5 A9 _" `3 F8 x$ e: Z0 \2 I. ]' Z- K6 k! d5 \4 A
  
) U& q/ s$ t2 ?- `8 `  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 L; v3 k* d) H& [" v. h   ! j( T" v1 u- R% A
  Ping statistics for 192.168.1.21:
: N/ Y3 \5 ?$ j( i   ) q- ^. u: e9 _$ o. H
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
" Q. y0 a; E5 Q1 O- f( Q  
# \) }. C+ z  M; O: D9 E, D& K  V  Minimum = 0ms, Maximum = 0ms, Average = 0ms
: _3 B+ q" V$ Y! g5 ?  
, K  m4 _9 R7 H/ P8 G  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
+ n8 S. ?& Q' h4 t% j% f; U3 n. R   9 n9 l+ X) h1 R: R: j4 C: w* Q/ m
  -n count Number of echo requests to send.
. P& |( d% B+ q+ m6 M; [) G   5 |0 u9 @% Y% A
  发送count指定的Echo数据包数。 3 [& Q, V: G, `* }
   0 X0 E* b5 _+ c  M) E; J7 a$ n
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 8 h- g' E3 I) F  u/ l/ o5 E
   , I2 c( t- H. g  n/ y
  C:\>ping -n 50 202.103.96.68 * f$ c7 \4 \' O0 B! B6 @9 Q
  
2 \) h8 P6 Q. i  c  Pinging 202.103.96.68 with 32 bytes of data:
- _6 J6 O& _: A% e   " T0 v! ]  x, B3 `% Y, [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 I* R# L$ I' B8 _2 W4 I. O/ d, M  
6 u* G) f0 J% k4 l, ^  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , g% X5 g' X& N
  
/ E4 T  ~3 Q+ H5 F8 a) I  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ Y2 v  G  ~' f* b1 e% A! M. C4 ?  
4 C( R$ e- s/ K, s* a, W) L7 d% k  Request timed out. / {5 `$ K3 D- p
   / O; f: A6 d- |# f2 P  g, h# K
  ………………
# b: ^; O$ V/ j" G  j/ ~1 N   9 L* M% ?4 ~4 Z* f" U  [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  F& R' F  ^7 l% C# T& r% G# |  
+ \6 j! Z, t6 C" u/ |  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, {: o6 b, m$ U3 K) i  o   ( `4 x* i" [' [& g
  Ping statistics for 202.103.96.68:
' Y# n- P! H$ H& Q6 a; J  
: ]! o4 S  h  ~1 y# r0 }# {  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: " Z( d- u1 O0 }
   ) X/ C$ V9 f; m" y* b- t1 ]6 @
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
  O. Q# w4 e& k/ f) _   7 t% ]+ B% P" ?! j7 B- ?- U3 t
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
! a6 n$ R6 a9 j$ g/ ]5 @  
( c/ W4 }/ N6 j; k) Q  o! M  -l size Send buffer size. 6 _+ ~* H. @% }3 F
  
) J# f3 x% ^3 {' C. G  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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