Board logo

标题: 教你正确使用Windows的Ping命令 [打印本页]

作者: 野人e族    时间: 2008-1-27 22:16     标题: 教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
& A) `  F! t4 u# w/ y$ [3 N   8 n9 G8 m7 y; T) b0 C& r  i' ]
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: $ `' S1 ~" a& V
  
1 t( E$ J6 d6 p% B+ L% X  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
0 a; R! `4 Z; o7 a; J8 L" ^  G; }  
9 ~5 H3 ^5 w4 z  Options: + O) O" t* h+ a
   6 ]% c9 g+ B% D0 m' d0 w) _! u
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 |/ T' L& W0 |, Q4 A' A
  
& r, q& b  w( m( G) J  不停的ping地方主机,直到你按下Control-C。
3 h" ]2 c4 O3 o! m8 r% ^  
" n2 H5 g; A5 w3 p) g5 l  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
* G* e7 r! }" ?   6 S9 R) D: u. r2 [, p2 X
  -a Resolve addresses to hostnames.
; j0 R9 ]  }: u* {. N, c  
$ u) S- e4 w% E' Z# S  解析计算机NetBios名。 " W! V5 W2 R+ C
  
% V; m7 [7 t) a! g* O  示例:C:\>ping -a 192.168.1.21
8 H* \0 C: o' R+ |   " R7 `+ T6 f  Z2 @! `/ M9 L
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
6 t1 s, @) m8 q( O5 F* `# ?   1 ]: B! a8 n8 ^  x& J! c
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) E+ T# |% [) _1 c7 i( w1 E+ W   - W0 y6 g* H6 j1 ~
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   @# j, A% D! _' q; v
  
. V! L+ G: i% n; k) n! A8 n2 k" Y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: U% V& e( I7 Y0 Z* \7 {3 @* |- p& S
   1 n" X, P& M1 B) t5 t
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ y1 n- T/ a0 i6 l  p+ o  {7 Q   4 j: C4 l( w$ Y- t" \8 T
  Ping statistics for 192.168.1.21: 8 S2 P8 Q! z9 a" j3 x1 A
  
/ L+ W0 [) t/ ~! q' ~2 s. ?/ u  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
' _: n3 ?4 Q/ D, |   , ^" }: h5 T: c5 G+ i' ?
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
0 ^, [, K& [: p: U+ ?   / D7 H# h" V, Y" t: Y. b% H
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 5 g3 d4 _5 @( N: H% d# Y
   ( d  b9 ]0 k1 X- ~1 n
  -n count Number of echo requests to send. ! h. d5 ^  j9 N4 V/ ^
  
  [4 h* g, L/ F! m  发送count指定的Echo数据包数。
8 t5 e7 T, O" t5 l  
: s3 t( x. U- e) J+ e  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ' O) _* h0 d3 |( m
  
; W2 M7 c/ s2 V8 ~; ~: a5 u% \+ t  C:\>ping -n 50 202.103.96.68 2 _7 a$ H- d; v4 c; i( k. [
   1 B( o, @# x, K3 J7 D+ c% }" m9 l
  Pinging 202.103.96.68 with 32 bytes of data:
% }  N, U5 r/ C2 b! @. G2 g3 Y   ) a! @' t- |8 Q* m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& Z9 q, s' Q- x5 y   : m8 h; M+ Q3 h8 g
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; v6 h, b4 |1 S: ?- H
  
% @2 x3 B. X! w  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # F- S( I( [8 d. p
   8 I0 B4 N4 E1 Z0 P2 r6 `% e' |
  Request timed out. 7 a! A( }0 W6 J9 f
   0 W' r% u, F; ]' C
  ……………… 0 k: V/ a& G- F0 J4 D& i$ h& S* I+ U
  
. N; M( L( Z2 `4 C7 n/ {# X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 C* o4 I) M" L( j  {" Z
   ' j) }$ R8 I/ ^3 c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 ?' s: ]3 D9 _# G8 N3 M
  
/ c, @8 O4 _9 u8 ?1 P, N! y  Ping statistics for 202.103.96.68:
6 N- O4 p* {$ V: L  
, ~% P4 z# V2 i9 S$ N7 Z- m# J  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ' M3 t" v' H! ^6 C! m3 b( D: s
   ' P, ~- Z3 ?4 J2 ~
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ; F) F3 a: z0 r, l
   " q! V! B( f- T# }5 R
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- P4 c4 \2 h7 m# y7 `% [  
7 j; N# d- X) {% U: `9 q  -l size Send buffer size. * D: t# ~9 p) A
   ' i  i  \" Z/ e! o: M
  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




欢迎光临 捌玖网络工作室 (http://89w.org/) Powered by Discuz! 7.2