Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * q1 ~. ]6 Q) d& }
   ! E6 d( e5 x! d- a3 d2 Q
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
. Z5 |; p. d- h/ U   & X. {1 A) `- N9 \
  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 * Y: C3 y8 I# I: p
   2 D7 Q( A$ @, ?" V% ?+ k" }  e
  Options:
, w% l. d* ]  o1 G+ |; G7 S/ ^0 I3 n  
, Y# ~/ }3 T$ Z# z% R  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
9 |" L5 E- r- ~/ N   2 z, a* {+ g6 g, p$ L
  不停的ping地方主机,直到你按下Control-C。 5 [  k0 X: s1 c: C
  
2 H- L* @% ]6 d4 i' o  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
/ L8 `4 i$ a4 a# c# s/ W# Q   - V* S9 o$ R* l( m
  -a Resolve addresses to hostnames.
- L+ T7 E3 s3 `   , y" F3 D( U, \
  解析计算机NetBios名。 * ]; o1 u# e. D4 j
  
7 s; \- B( T  h# k  示例:C:\>ping -a 192.168.1.21 7 j% \  }+ T0 w9 f
  
8 c% l8 l# d- k8 T( n& A$ y  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
, y# W% ~( o5 A4 O# l. M0 ~. w' S  
4 @" x( E. H# s5 R/ i  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & _! W% ^5 }' A+ c: V0 f
  
8 c+ w( \" h0 @. p, U: |9 A$ ~" {  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " f( G5 ?. W9 E" L3 }8 H2 h
   : g( o4 Q6 ~5 m& @% R5 d2 l1 Q/ L
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* @& t  W" \" z6 {7 i. m, R
# ?* S( ~  J" t$ v  V9 B7 }- T" c   9 |% A% ?+ |7 n  e9 ^" _# C
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# C& O( d) P& k/ u2 V' G1 ^7 C  
/ ~. G  _& ^( @: z' P5 ~  Ping statistics for 192.168.1.21:
& |& k" v8 E( k  B4 {  ~, i   ' }* W4 r' P0 p& N, a
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
  L- W, B* ^5 t* T1 [+ z   8 J' E2 N4 u  c4 O& H
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 A: b5 l# z- ~6 h! }  [   # r" |. z; R6 p- H+ X; ^: h0 ?
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 9 o7 {; r6 T5 v! e( t
  
' v: c& G7 S6 u( }( `- ~  -n count Number of echo requests to send. ! O1 v8 R: E- Z' c2 U  H# ]
  
+ Q' q, g2 D; |, u  发送count指定的Echo数据包数。 $ c4 H: E: r. W+ ~
   2 E4 u/ C, [2 {* \7 O- U4 q8 A
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
8 t) J( c4 K+ K( |  
8 |; f1 `; K1 c0 k# l  C:\>ping -n 50 202.103.96.68
6 E4 A" z- u9 _  B3 H+ I   ' M6 I2 j8 H, s+ n
  Pinging 202.103.96.68 with 32 bytes of data:
" e: h9 x* c& K   % i& f& \3 I# H, X& Z! D! `
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 z- T% s* {0 E1 n1 M  
3 K( L1 }8 u& g3 Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  \# p* c$ D! T* O8 S   7 V, y2 ^; q% U3 n
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 `" d. p- ?) a( [) z4 \! T# _
  
& F1 k0 O+ O  X8 l) B  Request timed out.
6 h5 s9 d7 I) O8 \: r   " c2 S9 U, y) @: `! [0 F4 |3 d
  ………………
- V* w  n8 L$ D& p3 r2 S  
& _- l5 a. Y/ {0 ?- |& O; v  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 z) D  L  V4 @5 {2 I- t
   9 v5 x4 k" Y' f7 g3 Q3 @4 {* P
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * W3 V+ K# [. S
  
8 B# J4 k1 _; B  Ping statistics for 202.103.96.68:
; S5 {% K/ J2 _7 I   % M/ ]: s8 C" g% I
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: + x7 y6 ~) T# d
  
3 k- k. Z; y4 T0 a  Minimum = 40ms, Maximum = 51ms, Average = 46ms
* f5 y2 c5 U1 V     ^0 n: O! `* Q4 M6 D# a1 Z
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
" a0 {9 n: b6 L& s& ^9 a: p. \+ }  
, I3 L/ t3 `! u5 y/ Z1 |+ L4 a  -l size Send buffer size. ( w9 r8 u7 i: H9 h9 X  {* y
   - @8 {! `+ W3 J8 u3 e6 B4 B0 r
  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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