Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
1 |) P" g, ^  v- |! V9 @7 [1 z  
) H7 I* {7 t, R( q+ m  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
3 M" s. P" m- T3 C1 \4 |+ _   2 c* i7 o; Q3 O1 r
  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 + i  Z* h7 C5 I5 Z% j( g$ \  l
  
8 D% g: g% p! [. X$ \5 `  Options: 8 V9 E# l' C* O% s
  
9 R  N& o1 n2 a  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
/ R; S( R% V5 q8 E! t  
4 ?% z$ M$ q9 Y2 ]+ A( U  不停的ping地方主机,直到你按下Control-C。 / Z6 [* z! A8 U
  
# w& J' [1 _- f: P$ c  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
8 V. X0 _& w% D   4 w: e- ?0 H9 l2 O% q
  -a Resolve addresses to hostnames.
- M: }. ]2 ~0 b2 k3 l  I   - G& E* `7 V; S
  解析计算机NetBios名。 ! Z6 V: P9 [  R4 _5 C8 h$ _
  
5 n5 Y4 _0 _+ P8 @; h  a  示例:C:\>ping -a 192.168.1.21
: N& J" h7 }: Q1 x  ]   / X1 }1 Q  |- ?4 z
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , h5 ?' ?/ @) f; M, r
  
, m# ^7 t. O8 m  K4 l; ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . _  f! n  q7 B& Q. y  m/ b4 Y
   6 K4 H: B  J( l; D5 c! P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ n+ K1 b9 h% |( M9 |  
7 k3 t! k3 D: {8 T: l) e2 L1 @7 U8 O* J  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  q: d% z! M' L" d- L* V6 }: x( L2 i, h2 x
  
- W1 x7 j/ I! u/ F; Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& f, G8 |4 m  |   7 s% X; G. n; c3 m) K5 P
  Ping statistics for 192.168.1.21:
$ z8 v$ |7 v# Q1 p. ~( w. G9 U4 ?   + k3 x8 O4 r* g
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
* [5 ?. N$ u% `/ h  S; X   ' w+ u; C( u( z- ~! u
  Minimum = 0ms, Maximum = 0ms, Average = 0ms + R/ k' E% y# q& y4 E* @3 W9 u+ W
   % ]: B9 Y2 n6 x* N8 Q+ {
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 / M, g* \4 m8 d/ e; Q8 L
  
8 q1 W1 L" o  y$ f  -n count Number of echo requests to send.   j# m1 H' ^) d; c5 v+ l
  
% e1 e# Z: q$ v6 i* x+ h5 c7 i; \  发送count指定的Echo数据包数。
4 F; K. u# _$ F& V1 U* R! q+ T+ r, y   ' D9 j$ `7 r) P4 K% M8 R8 V9 x
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:   f# ]8 @: ?2 ]% K5 {
  
1 h* t( V% y8 j) s$ T! M3 g. Y' a  C:\>ping -n 50 202.103.96.68
& v; p$ m7 i7 V$ A, P  
2 |+ x, u, l9 U4 }. F3 G9 e' I  Pinging 202.103.96.68 with 32 bytes of data:
% i8 g% K' ~+ j. N: y% f   " I+ R! P+ N+ P- v. _( E7 |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 u4 C' @/ V) T; P
   9 H8 ?" e8 o7 h. y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 @/ ?5 a8 z9 B" s( X( p   2 Q( c( g' |% j+ P  b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : S8 P, {( T: f9 C4 w
  
3 ]) ?/ i3 n1 O# Y0 q5 D  Request timed out. : M, {! Y8 B) g& A4 @
  
& Z/ A: R3 t. r1 R: s( @  ……………… 1 J; B. f8 r4 h+ u3 i5 s
  
( W$ B( G6 `; Q7 X2 }- S8 b4 h  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , |2 K0 \% T9 \9 V$ v) T. `+ J/ W
  
& v8 X0 d( S' e" B9 [7 }! q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . n6 |' T# I3 c/ ^+ l8 f8 u  E% s
   2 g+ z6 j7 n- _3 [' S* n
  Ping statistics for 202.103.96.68:
+ D( N9 b& b! t; r4 \  
4 i9 `& _3 `* G( n9 a4 A& F0 n  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 8 K1 o) h5 K8 `) d3 ]1 ~  E
  
! E' B+ w0 Z4 ?) [  Minimum = 40ms, Maximum = 51ms, Average = 46ms
- j7 P% B( ?+ x9 p2 C6 e  Y  
- K5 O. b" e/ h8 _9 Z1 }4 S. K( [4 {  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
2 ~4 T. e; |5 E" l( C+ w   ) W( @! M/ ?  c2 m# M+ I
  -l size Send buffer size.
& s2 c6 w+ X, }) _  
, l& C4 i% o  x# _  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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