返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * K+ q. K- s' e% a
  
: x4 V/ n; M# f+ e% j" A6 z  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
8 G- z9 ^2 W2 S   6 e0 i. z7 i8 q
  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+ ~6 ?' Q( X   2 U0 N6 U% J% ]4 O" E
  Options:
! t% _( @) O: Y, N   * p! D" P1 L4 j7 o7 G3 r) |' x
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. * }' i7 k1 u& Z& L
   , q, y" s' n0 @
  不停的ping地方主机,直到你按下Control-C。 & V% o7 d4 k/ i# Z3 M4 T9 W+ w  E0 G
  
0 l" c, _( b7 |* _9 [  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
5 E: o. f1 s0 A0 F5 z+ E; d& O  
6 U  E. Z- g& U' N/ _  -a Resolve addresses to hostnames.
, n  x7 h' ^1 W   , {; V2 P$ R1 N+ Q! P
  解析计算机NetBios名。
6 m% \% {1 {# Q$ N! @# A$ w   3 b9 g' H8 T) }! y7 F+ n
  示例:C:\>ping -a 192.168.1.21 " d$ W: ?$ `$ S2 X
   " J  F. w; w+ ?; S2 _1 c
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
" i- Q' i1 J; [   % c. `, e* e0 t; e; a/ r# |3 f
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 y, b- Y) x4 `
   ! Y/ U( B& ]4 C8 l. I0 r3 G' v- `
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 I  Y7 q& q2 V( B1 Y( L1 Y# Q- {, I
  
6 D' z0 a1 d. ~6 m3 ^$ {/ |  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # o! C: y  k$ n2 v: I5 y8 ~

$ A6 E  U6 e. m& \4 T  
5 t0 J/ p! U/ k- c, c" S  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 b  ~: ]% d+ z+ i
   / f0 s1 d9 {# t' _6 r9 R  _/ y2 j
  Ping statistics for 192.168.1.21:
& M; t0 g+ M+ d! z8 h  d1 e   ! ]. r9 A9 c% o1 H1 N
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
6 x& l9 T! Z" k" y1 L6 Y$ P  
8 S3 k  a& e: d  Minimum = 0ms, Maximum = 0ms, Average = 0ms + H* t0 J5 e5 N: x) [3 H
  
8 D+ e4 c- }. k1 O3 V$ ~$ x/ m  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
' o) Q" q9 o* N1 V  
; S# M- y4 N* f9 t0 d; m# ]  -n count Number of echo requests to send. + A+ q) T; g+ B9 g% b+ }( ^% X$ e
  
" C- s) A* s, Q# U/ j5 ^  发送count指定的Echo数据包数。
9 D4 Y2 h( K6 i   1 l8 l9 Y' x" e
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
# L9 i: n! P7 ]6 v6 f  
3 U8 x0 Z8 E, q$ d  C:\>ping -n 50 202.103.96.68 , M6 {1 t3 q; Z% B
   8 L1 r8 f1 t9 W. O3 a: _
  Pinging 202.103.96.68 with 32 bytes of data: 2 n* m  j( A3 z9 F' q' o' [
  
/ }4 p: r) }; Q8 p" o& O4 v- v  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # t8 c% Z: r) p
  
8 g7 o$ }0 [, x/ t, M) \, J. i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: B) `5 S  W: L2 B, ]  
2 k, B$ [! ]) o; g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. ]" A0 ?8 s* p; @$ j  
# E9 J& Z5 L7 s  P4 u6 O) J  Request timed out.
9 W4 Q/ O2 |" r- \   4 u# p3 @) a; Y; |3 v! p
  ………………
# e* p" |% ^1 V. K+ N* W; g' G   6 t; S6 l% ~1 V, M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 P+ C: K+ E! N# y* j0 F
   & J" p: F  h- C9 ~' ^7 S9 w
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; g* {' @8 K( U: c   7 U* u8 u, l8 Y: N" R# @
  Ping statistics for 202.103.96.68: % I8 y0 b, M4 R# D( N
  
8 ~8 b# _. |+ `0 U+ X0 q  w. c: n  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
  J, l6 \) I; h, c8 O3 h   ; n7 i, X  y; @5 ^
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 7 W! X1 X; w' J( |9 l: N5 R
  
6 n' f5 B( o0 v. e  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
% }9 ~% q. D* z( {) f5 T9 K, J   " [$ y! E/ o; D6 M+ F
  -l size Send buffer size.
% ^7 ~- N# q2 P$ q9 c   / a0 N! M3 M4 W2 A8 X# d; R% `
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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