Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 2 G/ H$ d6 V5 P. k  |9 {  u9 {! A
  
4 I, b( }7 U$ c" c* p4 O! K  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 9 |* H, \' p; E/ W& F3 o+ W
  
) n) v) m% u+ v. ]8 |  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
# B9 w: x$ s4 a* H3 K7 t  
1 y3 g' s. [9 e  Options:   L+ `5 o6 `8 D, T7 R4 Q: M
  
, t+ W1 F" q6 M4 w* b$ s( ?  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
( ^# X, B% o' r  e  
0 d4 p& t- T; n9 J* v  不停的ping地方主机,直到你按下Control-C。 ! D" |1 ?! s' P4 O$ G. r: N
  
2 W/ p0 h* g7 H( X+ i  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
* A: Z4 y+ z5 b/ i   2 v0 y3 l- z& Y$ B
  -a Resolve addresses to hostnames.
( b$ u* J/ |. g' s4 I2 X' i! t   / |" u7 R5 E* g) C! |
  解析计算机NetBios名。
) J  v8 o) f% O; f. M% X7 ~  
( v( h$ W$ x! W$ {  示例:C:\>ping -a 192.168.1.21 ' x+ r" o$ z, E
   / r! s7 j7 ~  T& u8 S$ N
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
5 D5 v8 o( ^& ~9 I9 H   7 F% V6 P. s, J$ D1 F3 ^4 d" k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# R: W, d3 W$ f; T* }! W. J  
, _9 ?1 @, w  `; a  j  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & w' B4 l* d4 x. i
   . d7 _- x8 s  Z$ J( M: S9 }
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 u4 M2 F; `: |4 g8 G9 j- d: e: m
/ o2 ^5 }) f4 ^9 B6 y+ h  
2 _5 j0 p$ h' ~( l! W8 W0 w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 f7 t& j  Q4 {1 e  
+ k+ V1 J) R. t' {  Ping statistics for 192.168.1.21: & `) |6 o6 n. D% F( D
   4 I9 T- L, T; o; w) G
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: , @4 u( ^2 I: w1 m' \
   * G% F( W: a/ F& U6 S
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
5 \. c  z1 K/ A   6 W3 {0 p/ F& x  b9 D  H; @
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
& c' J8 p( r6 I$ m  A& \   ( i. D" o1 T6 X2 K0 m( B( k
  -n count Number of echo requests to send.
! Q& [8 E7 j1 l9 X0 h1 f; G   & t; L% N/ F( K. S" g" `
  发送count指定的Echo数据包数。
, D+ M2 P/ E) U' k  
" I- Q) y0 p/ s- E4 `5 h& V  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: % r: V( S) y0 P8 g* X) C
  
) J" }  G* a' R8 ^, B4 V- y( Q  C:\>ping -n 50 202.103.96.68
( f7 S$ A3 N" L9 V1 n+ V- U  
& M% S. K5 w4 o& P' ~  Pinging 202.103.96.68 with 32 bytes of data: , H* a+ V' z5 `0 X/ }+ @, W; W0 k
   / I" K, |8 p& e: y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 K/ w5 V5 B$ j5 M  
0 F# i- O2 ^7 x* Z) {$ O  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 D  g' R$ ~9 A) t   7 V# O  @8 O# P3 K- U, M' V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; y) M9 q+ I! ]+ W9 q9 C* |+ \
  
. p7 ^6 l) f4 I8 X0 [, x/ ]. n  Request timed out. ! k. ]4 ]5 @7 ]5 v6 F
  
/ z7 ~# M1 d& f% s% r  L  ………………
  Y7 q/ q8 T: `  w1 ^0 z   2 q% D$ p$ K" t/ `# v2 q! j& |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & \, P. R2 ]2 |: l+ ?
   4 [2 d& S5 S4 Y) N7 n# t
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 ^- u; h% e5 k2 R: I: j( d9 D, `  
" o5 O& y9 p% v/ x2 P  Ping statistics for 202.103.96.68: ( ~% X. ?( e. n+ X- N# N
  
* L, q2 X, M3 @  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
5 {2 o; ?; ^$ b# z, y' ^# c: P6 k# b  
  o+ E' D/ `1 ?& Z  Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 w' A) j- D+ m/ @4 z7 N
   ; C: |: G" a& K; s: C& J$ [1 J
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
  v6 F' j, M$ v& H! G' O   , H2 Y5 u& c: N; W7 ?/ t
  -l size Send buffer size.
) x% N! G$ T$ v  
! j# u- y5 a& Q# ^, ~+ U7 n( D" a2 ^  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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