Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
  Q! C6 l9 C& [# j1 _) D   + j( F- v0 L- d
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 0 p) X. V9 v% u3 ?5 F9 R. c2 `
  
8 w: U5 S+ t4 T% d  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
- T/ d7 ^) ~. P( D) ^   # y; D% P1 t' x5 |+ [$ f
  Options:
5 d# m5 S( J% N2 |$ @/ l! ]   $ \. C. J& u  d1 E5 D* A+ L  G
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
! M1 S' O/ S" n5 S& \3 P  
4 Z0 u) a# b8 F" b+ [9 y  不停的ping地方主机,直到你按下Control-C。
! ~0 M1 w* I3 v2 b   - N: ^' i. Q% w$ e2 n3 A5 H2 X! b' ~
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
6 c: j) d8 v0 ~  Z1 k  
! Q4 [3 R2 f$ q* a  -a Resolve addresses to hostnames. & N3 C# b" Z+ G& A) E! Q5 s  x
  
& C& b0 R. P) Z5 \. o3 a0 T4 g$ X  解析计算机NetBios名。
7 U  z& W+ Y: q, \   5 p: t4 U4 J5 U; g7 g
  示例:C:\>ping -a 192.168.1.21 ! M; E! Z$ E, s! o
   3 w, t3 q$ _' d$ k  j
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: * O- X$ @' i$ d  l, y
   9 b  T* t. j! W" |- n8 V
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 H- Y# W  |! |$ \1 V$ r# u' X# e
  
1 `! `! y/ _6 ]! q9 w# Q  U  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 v0 X" M" d: z) T  B7 W( u/ T) l
  
5 q7 ^! J3 {2 e  z/ t0 E" [5 a  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 `: ]$ ]& X6 V+ x+ s( t& j* ^: F: ]* z0 S1 f: }
  
% V% {4 |) o% V: _$ s; C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + a3 s+ l7 \8 T
   ( d+ t2 z* }# G( o6 ]( C5 @/ {
  Ping statistics for 192.168.1.21:
( T6 b; b) d# ~3 e+ d  
8 g1 G  w( ~' h2 p5 \* K  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
# q  ~1 r  q) K) V! F% n2 H   - h: ^& ]" ]) x
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
  {7 Z$ A- r9 i; B# S7 O& N# |  G  
# l0 b3 C: B- F& @2 G# R5 g  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
- p. T, V- f6 T' e. K( G, ?* O) R   , o  r$ `6 T/ n1 x
  -n count Number of echo requests to send.
* s5 p" p" }6 U   , }8 u$ [3 C5 R$ B6 S9 w5 s
  发送count指定的Echo数据包数。 - }: U0 [  x6 H! U. l) O
   8 o2 U9 T% k8 ^; I" L6 w* W& Y
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: - U8 f1 p. R+ i% i, }. ]
   9 Q2 E' i, d2 @3 ^1 b  L# g/ p
  C:\>ping -n 50 202.103.96.68 & K7 H$ Q* g  r) [8 T" T- q: u
  
: @" e) b# u! w2 r1 j# s0 P  Pinging 202.103.96.68 with 32 bytes of data:
9 Y; G0 ]4 _" U# [5 f5 J# S1 q! L  
& T& ^2 d' t  ]( S" {: {" x  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( s6 b# O' V2 i$ ?   . t/ ~$ ?* n3 D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 \) N, s3 X! ~  
! V4 d9 N7 R! F  C) V  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" N% c* ]' g+ `4 x   ; i( L5 G) Y  T- V
  Request timed out. " U( v% ?9 c' l0 Z
  
( p: n# t- ~% R2 }  ………………
1 e) f! x9 i% D0 i* }+ l: K  
7 Q2 u+ C7 V# P4 K  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# D7 Y! s% y" D. e   " w" _6 t# D6 F
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * L7 _7 M6 i& d9 Q
  
: u# S) _  t' W- e9 \- l  Ping statistics for 202.103.96.68:
* {5 K1 U* d; W' _4 K' @9 b   ( A( l  G& Z+ }0 f; }, k* |3 t$ t
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
+ |. x4 U; }/ ]  
9 }; k* S: f4 d' L, C' t  Minimum = 40ms, Maximum = 51ms, Average = 46ms . S1 l) G6 ~2 `/ }" u  A
   ' p' f* z! [# S
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 . q) r( {0 d" p, l' e! v
  
! T( D+ F0 m9 j9 i4 L' ?  -l size Send buffer size.
/ x! l# D' x3 w6 f: Z5 ?  
6 O/ y/ G: u1 S: c  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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