返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
1 y! _' p( h% t6 q0 h   # `2 i( |$ w  o" I4 G$ u
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
! H/ P8 \" k: J8 J   ( D! Q9 h% C% c
  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 % N1 n7 i/ @" k5 o- C0 }% I
   ; V0 a0 B) Z0 n; e8 }7 |
  Options:
1 o7 \) \. ~4 s  [  
  Y! W! l5 X2 E$ j/ {$ G- g  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 7 c5 x) X0 d2 n5 J9 o$ y' N
   % o2 q5 u5 y1 v* d
  不停的ping地方主机,直到你按下Control-C。
6 s1 i. q, I& g  t7 D4 g% t+ e   3 f* ~& W5 q; h! e& l) t) V
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
. O5 O$ r# t0 m" Q0 Z   : Q  C+ e! ?7 [9 n( S  j: o
  -a Resolve addresses to hostnames. , D3 E7 W; j0 ~7 Z7 E
  
* R2 y6 s3 W& E- g+ k) g( S  解析计算机NetBios名。
! \: B! S1 s3 k6 n, @- s   & D. P& ]& c0 P+ W1 b" \
  示例:C:\>ping -a 192.168.1.21 & h: X6 b( b( k; O
  
+ Z2 S" u- C3 s8 ?) A  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! G" ?5 s5 e1 \7 ]   ( r$ z; A, L5 H* o) v6 S& u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 P5 k) O; E, |$ p: \/ u
   3 p4 ^9 h: |" W5 n% K
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* D. ]/ i% }7 v( [% P( m  
3 G' o9 p' c8 y6 e: t6 t! B  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + N+ i3 Y! q' B4 U; q
# f. E4 j0 w" x( ?+ L9 V, G# T* }
   " V* ~7 X0 X6 z  |9 v* Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' n7 Q4 t4 K) |! o6 q0 D
   - `7 j! Z5 T1 R; F4 K/ X
  Ping statistics for 192.168.1.21:
) e2 t" H- o  L8 \. W$ t  j  
) a  X9 a/ O& K# ]  u  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 4 p# J# w% s. S1 G
   + h' T# ?  L& n8 c0 y  m
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
2 x7 [0 V/ `8 o+ B! Q' f. p  
* m& N, j( f/ w; R) \# W% t  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
# p  w! l1 G" C( |) L   $ V$ c5 T* F6 r. b7 }' k+ b3 `
  -n count Number of echo requests to send.
6 P, Y! N  c* X4 T/ p   7 F+ T' a9 R; ?- d: J" T
  发送count指定的Echo数据包数。 " @) P- J: x. q. }! F# ]
  
% i* G; G4 \% V8 ~  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 8 A8 z: w/ Y" \7 U, i
  
$ G# W. T2 r$ q+ i1 O9 d( e  C:\>ping -n 50 202.103.96.68 ' p) S3 {3 y9 d2 I/ N7 q% B8 R2 B
   * Q% B* Z1 I  I8 F
  Pinging 202.103.96.68 with 32 bytes of data: & [8 E" G; Y2 r6 s0 N
  
0 A# K4 {/ k3 ?+ w0 B  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 B  Y% D& h- m  l7 O0 }   0 ?5 n" V/ k8 N+ w' @3 q6 w3 T: \
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " i* n7 t) x& j
   5 R% O% ~1 n2 ]1 }1 [; b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / n+ H1 n. G, z  O% @0 `
     ~3 N; O/ _- Q. [: B9 ?: u: b! }3 o
  Request timed out.
' v7 r+ e* V7 A* i) V" K  
) `/ u3 k: d! h# ^. |  ^  ………………
/ Q& z# F+ z( N9 g2 K" @) N0 v( M   $ k  \" s3 U7 \" r9 L$ w
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # O/ z( \1 l' B! O3 B4 a
   * A5 Y: z& W+ C2 f( X2 q) {( v7 P
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 h/ A7 b, `. Z. }" U
   3 B0 d8 o' Z# ], h2 R
  Ping statistics for 202.103.96.68: $ K9 ?  K: t' ~& U  u% V0 W" D
   " }$ _6 y2 |2 B/ X" I+ M2 J7 D
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ! ~) \8 u( V" N1 N! d7 a
   9 J% s  m5 U5 C3 V1 Q  k/ b
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
: V4 G& o  y5 q+ e$ f   % z& f" P' p5 B% m5 D
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
6 P' j0 O5 u  a! j. X) j   3 D" L6 N$ u, ~
  -l size Send buffer size. / T5 I. K6 J2 |" }
   , N: y, X; a) F3 i) r; c
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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