Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ; G) i4 B" Z: u, N+ ~; x$ |
   ( u! k0 a' x" K2 t! b0 e) \
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: $ d' I# [4 ^) S; D+ i# q9 V
   # `1 I. r0 a% ^5 Z6 Z* o: {: 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 4 h  C# D9 B9 k/ X
  
% O( q: M* [1 h1 s! V  Options: # E& l: k9 b, f# Y: A1 l
   - K- H7 S+ x. }$ ^5 }
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
3 F3 s, J6 ?: ^   * a9 M( D$ R7 y& s- {; }
  不停的ping地方主机,直到你按下Control-C。
* J* C6 l' _, _% W( a( {# I5 P   % l8 x3 ^7 [8 I% B2 c8 Q# r
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ! I; Q2 s+ E( \5 ^: N
   ; w. C8 I$ X; m3 o
  -a Resolve addresses to hostnames. 8 u5 z5 r) L- d1 L2 W2 i" a6 M/ V
   1 ~9 Q' v5 s+ g1 K; I& D, Z8 ~, |
  解析计算机NetBios名。 : K+ S& m  A: J
   3 W6 a+ C3 q; n" P
  示例:C:\>ping -a 192.168.1.21
8 X' e+ l( }8 B# {/ B( h  
' }7 x$ V& @* \" A& c% Y' d  I  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
/ u9 F! t, X' n8 y" d! S  
8 U  n% B) ]0 X  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: _5 v* W; g$ Z* X   6 {, ]( Y+ k- ~- p( P( \( E6 [
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / z5 Y5 t6 p5 b2 @+ u
   & V0 g! P( q8 Q- p% E
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 \! [1 e# @8 M6 o3 K# E8 J1 K2 P) L1 ^! ]
! T' q4 d  T9 L* i6 B0 X3 J
   8 D# c+ |5 }  P. q, f5 U
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  D" ?; S+ A, B  i& N- ?  
3 A6 t0 G- \& {  Ping statistics for 192.168.1.21:
  u2 i# Y% S( H7 h$ }   ) Y# U$ N3 l6 i9 X" L& ~5 F' ]
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
# ?; d8 C8 v" U  
% U) ^% i+ M3 B' o( ]5 }  Minimum = 0ms, Maximum = 0ms, Average = 0ms % b9 p- f1 b( e* @2 T" |6 q5 C
   5 F+ l! b3 w2 N, t
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
$ |  w  [( P2 ^) q' `: `) b   3 X/ t4 j1 y+ [
  -n count Number of echo requests to send.
6 s, G* @3 q% K5 J5 _& [* h; [  
, [  g  Y2 ^. r% E3 `  发送count指定的Echo数据包数。
) D3 M* C0 ^2 R* [8 x' ^! f   0 f1 K, L8 ~9 s: R1 }" F
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
- S' |, Z$ L: L  
5 [  w- L" l- w3 ?! \+ A  C:\>ping -n 50 202.103.96.68
, H6 z* [7 m' l! d! _  
0 Z, N/ f. D/ h( F6 U  Pinging 202.103.96.68 with 32 bytes of data:
* }  I# B0 N) j8 t8 T  j7 L   $ s" n4 _" |/ H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; V& O3 p* |+ v( J1 ^
   ) K3 c8 Q2 R+ @
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 @5 m. g; I7 t
   $ `$ j  X$ A2 S) I3 j
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' G' h; U4 U5 }% v3 |) e  _   0 [9 B" W3 Z$ }4 J2 ~
  Request timed out. 1 n" k4 R! F6 x. V& C$ b
   % ^, `4 I' x. }, S
  ………………
' M5 Y7 V0 V2 a+ B2 s* B   ( a* J* ?' s* z& z" i& V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% f0 Z# U' l! }5 y  `7 J; H   7 S+ n1 O, T! B. n* ~
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! M, D- e# {) b8 V   2 {& X! S/ R7 q+ g" h% f
  Ping statistics for 202.103.96.68:   A& P/ h  Z8 H
   , x: I8 B" a  @# o6 ?& T/ e. S
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: / d8 |+ [8 I2 u5 r1 x
  
3 X$ X1 z2 e5 c. Z7 i2 {) \  Minimum = 40ms, Maximum = 51ms, Average = 46ms * O4 I6 ]3 v" Z( E2 M
  
( O0 t: L0 o. ]' n  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
  _3 Y# S  O4 ?5 |5 P   7 V" ?2 r# M, t. f# N" O* `: l
  -l size Send buffer size. 4 {9 b" z, Z% q/ @2 g# o9 ^# M
  
  U0 o6 e. H( j% r* V. A; H  d  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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