Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
# s# _$ T( n. D  
" K0 M- G% F9 R  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 5 N2 r# D; r" E* z; \
   , P) X# v  m4 G+ e# H" j2 Y
  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
3 {2 O. j' h. A  
7 m0 N; a/ G. E& m0 ?  Options: % T7 N" F+ @  O
  
' r$ x% Z' A  T4 b3 I  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
' |. n) e3 r: j% g7 l  
3 k: c3 k/ Q+ F  不停的ping地方主机,直到你按下Control-C。 ) q% R% n: |6 U% y$ l. e
   ( V2 Y  L0 g7 d) c- A
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
% Y) {6 C6 F  @3 a" D9 J   ' B. @9 b; E6 f
  -a Resolve addresses to hostnames.
  X! n2 Y% ]9 h8 J5 i3 g7 Y. h  
$ s" K2 T; g0 F  G. N  解析计算机NetBios名。 9 Q% @5 j+ X6 W6 a4 C
   ! L6 o1 |3 k, R7 W
  示例:C:\>ping -a 192.168.1.21 - Y! R9 U0 V& u+ ^4 A
  
5 {( B! b! _2 _, L# C* J( c1 K  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: " j1 _8 D9 ^  J" w# ]6 a
   ! r3 @7 }6 K6 G. Y0 m3 h- ~
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: v% F# f9 j* q9 a5 f& q  
! t+ J7 W1 q0 Y3 [. Y' G  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 X) v! C6 C* d
  
7 _8 X& n6 C, E! U, \# N2 ^  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. D) t* p5 ?- R0 G6 |0 C' G, e
2 h( J, G, E' S* {! v/ d   : A+ O7 J' a+ r' k8 K& |, x& i* D
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) K5 ]3 ^- E; @: c" B$ Q. i; M6 V
   - T5 {: H# }& R' Q
  Ping statistics for 192.168.1.21: # [+ {: q: ]0 l; S' }9 j: X
   $ Z* [( g7 M$ {  o1 N
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ! L1 X& E' k2 e( s( E
   0 K2 w- O; K* K. ]3 s2 w4 F! s+ ]* {
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
6 }: x. p- Z9 f8 C! s8 B2 b   8 @. M0 A4 Q- E6 P) O
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
; c! d7 {. G7 k2 p7 [   # u, D$ M5 n/ p" E' t2 A" O# j$ z
  -n count Number of echo requests to send. , a5 F7 e9 V8 m# f4 m* t6 g
  
3 d2 X( ~- ^+ f  发送count指定的Echo数据包数。
4 v) W0 w/ P; Q; o  
7 }  K4 b3 y) g4 ^3 h( V! }" b) p  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
; d% C; m2 |5 e( b; ?9 y4 f8 L: g  
5 f, B! ]3 B6 ]1 J/ ?# H* u  C:\>ping -n 50 202.103.96.68
( u# Z. C4 G; t- `  
" ]; {. e& ]" S  Pinging 202.103.96.68 with 32 bytes of data: 8 A7 G& P3 Q1 G8 z0 D+ }" e
   : Q8 e4 k( g1 R  i9 x) W" }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   l8 _: Y) n3 @  `$ _6 d
  
5 _8 Z. S, \8 {0 D) v! W" q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % ~7 G: \% C! Q" v
  
. g7 c$ z5 |( i  G. \# @7 d  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , B( F' @6 F6 F1 F+ y: l
  
5 s' g: `, [* J  Request timed out.
$ m7 r7 I2 p, p% A: N+ h* M: H  
7 T# p9 [" C& O! f6 B* S0 ^0 C5 q. c  ………………
' K. f+ N3 ]# B, t- ^  
' L& o- m, H1 j5 F  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 r7 m' i: N/ O6 {- }
   0 K, e/ S! N0 f+ K/ G) Q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 a$ |. C- a; u1 j2 o/ c
  
% @4 A5 I1 B/ p0 t  Ping statistics for 202.103.96.68:
% ^3 j4 @' @0 M/ O! m; k+ V1 x   5 t0 m1 z3 W9 }$ d( I, J; ~) l
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
2 x/ b' k+ W: R) e  
  _4 \2 c! t# c! c  Minimum = 40ms, Maximum = 51ms, Average = 46ms
/ ]) ]( D0 e& S% d' I) J0 E  
# v5 r* D* L8 a. v: \! t5 X  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
( u6 n9 g& t7 w! M6 h3 _3 u& m# A     V& h, k! Z' h) `
  -l size Send buffer size. ; m. S/ }2 y9 G: p: j
   8 ^  g: w5 u7 q. G% J
  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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