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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
$ H! B$ Q8 i/ Z   ; }% C) v6 Z- L  D2 E; c- w
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
; q' Z' b* u+ v1 s  G   8 C7 p- _$ K' H! m
  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
: K) _+ ]& B( T) ~  
* l( y* D/ Y6 u  Options: : y6 d9 G: c" V& g& D: E
  
2 H+ H, o1 }! N) E: H" V  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
* N1 D$ O8 [0 R, L2 v8 @  
) K; |7 M' l2 T7 M6 i  不停的ping地方主机,直到你按下Control-C。 . \7 K- {) j* Q. a
  
; j/ u* o6 b- o  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 0 z. v" F7 k( ^5 c6 b
   ( M7 v* [1 B8 B. t0 g: \
  -a Resolve addresses to hostnames.
: o8 q4 y, Q9 g7 y% h  ^/ j! a/ t1 S- O  
& A& Y- h' ^6 D$ v/ D; h) E# F  解析计算机NetBios名。 * W: b3 u& L$ U
   : ]3 z4 f" y6 K
  示例:C:\>ping -a 192.168.1.21
+ o. t  Z8 {' e' ?$ v' R$ O, {0 x: V   0 V8 F# [) v4 H3 m( K* `
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
. ^9 _1 M$ ]. @3 N   1 n& G, _, d" b3 E1 k+ R" |" N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 ?4 f: E$ D' a4 c0 I% x5 |" ?5 X
  
& s; O( v; ~( D( u0 \% N& H! \4 H  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # C. U6 \; @/ {5 \  _
  
: I8 p" W# z3 M( T  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ n& |# f9 W. \- {4 Z8 M/ q5 \

' d6 ~$ m& j  f' s! H6 M  
2 g4 w' n9 O, _  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 a  V4 l0 f; H. I, V, Q  
, ^/ O: ?' ~5 l. K( {, \& _  Ping statistics for 192.168.1.21:
0 y& q2 A1 ?- O# n$ V: Y/ G  
0 _9 m/ o& J: C7 G, C% b3 ~. K  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 2 Z- e9 b. N. M3 V
  
0 W, e4 b( W6 S0 p6 f, Y  Minimum = 0ms, Maximum = 0ms, Average = 0ms
. `+ K: y8 w( c1 R   ; {: q8 \! C, R9 R
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
* n2 m" Y; P2 t0 ]  
  [3 u! B- G) h: H  -n count Number of echo requests to send.
& P5 Q$ [! w  X   & S+ @6 E1 c" v' b3 I8 i" H$ M: r+ \
  发送count指定的Echo数据包数。 2 h) h3 h4 g5 I6 q3 Z" ~- ^5 o; W
  
* t. @- A- ]  h  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
1 I% H& |* i9 g   5 r% n6 o+ Z- J. n$ J
  C:\>ping -n 50 202.103.96.68
9 s0 i4 S9 _; ]3 G  
, y0 W) U  H8 C9 w! B, k  Pinging 202.103.96.68 with 32 bytes of data: & k6 B7 F# d* \$ o: H
   " e! u5 q3 z; ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * I6 ^: f! v% v$ D+ c% v. G
  
3 Q, k5 R4 |8 f  t9 [7 b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' b2 J5 v( _8 W* d
  
* z$ ?5 V! G& |. K9 r1 f  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 l4 m6 Q' R9 h
  
7 O2 R, E( a; u: _* u6 P  S  Request timed out.
/ M' `" [! D) r; J   9 f8 W8 \0 Z( X
  ………………
& w1 t; O6 T# I* i7 Z   , z. Q: p* Z$ f, U! U
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # Q& C9 R! A  j" l6 q5 h5 N+ T. L$ {
  
7 S  r5 l" ?& ~  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' v* C( G+ s, Z. @1 G; [, J% X: f
  
: c' G: c% U/ H! [  Ping statistics for 202.103.96.68:
# G# e. o+ z& x* b4 `0 ^   # \4 D* l$ t7 m$ `
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ' N6 [. Y: W( `
  
0 a  ^# i' Z" ~5 y8 H  Minimum = 40ms, Maximum = 51ms, Average = 46ms 5 i/ P" m) P2 G* b; Y1 W
  
. ]6 W; j0 v' T) ?$ \' G1 _- P0 \  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % G7 c3 S3 S7 F. T& [; d/ F* Y
  
1 M, A  h4 V4 g' P7 e# B  -l size Send buffer size.
# t7 S& F4 Q7 o% X   ( r* l# s% g% j; R3 {+ b
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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