Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 " g3 X8 @* q0 ]/ o% B
  
. N5 k0 N( u. Y3 ^  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
7 v7 I; ]; J3 C; U& e$ y4 s/ v3 ?; i5 G  
  h  N! L  Q0 T' H7 N3 x% F2 ~  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 7 h/ z: S$ A# O0 V/ t. u* M3 U& |% U
   / T1 S! m8 _* c% ]8 Y
  Options: 7 p/ g2 @" A8 |9 m
   & A) v1 Z2 r; ^! d* L9 P
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. & c, u& m* b* H3 _8 @! R
  
+ @3 ]0 w, Q( f+ M! Q! o! P  不停的ping地方主机,直到你按下Control-C。
1 p: m; c- a! ^   0 l, @: q6 g  ^* `
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
, M/ X* u! w/ O   5 |" s$ O* S1 c9 k
  -a Resolve addresses to hostnames. " F/ f8 f: d- ?5 {
   4 D; g, u# J; r: [  ~7 h) Y
  解析计算机NetBios名。
* f+ g) I8 }; @; T   / R/ N* W( K- L5 n) ~
  示例:C:\>ping -a 192.168.1.21
5 _2 |' N. X9 f4 C  
. V  U0 J" J" d. G; R! {  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! f- N) f. Y: \  
# z3 G3 i% b2 C3 [/ \/ Z! S0 ^5 h  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * v0 e" i! \5 E% P2 N' F7 U0 i
   0 G1 Z8 F/ u" c" C5 e; _
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& N4 x/ S/ {8 L) `( u5 f  
2 R; f5 N  R9 m6 i7 Y) C7 l  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 R7 i8 n( n1 C6 j: i- s$ Q/ l8 w3 a; h( U2 _1 F; O/ b
   : C. d, s( @5 f" ~& I! T' Z7 C
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 ^- }- h0 l$ I" c8 A. i
  
0 m6 A5 |" O% o' W7 i, @/ h' j  Ping statistics for 192.168.1.21: ! W1 }! u2 @  d( P- f
  
2 X9 O5 q* {- S3 d! J  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
8 ^* C4 d( n9 f" u+ M) d( C  
3 {& J  w, Z4 Z  Minimum = 0ms, Maximum = 0ms, Average = 0ms ' i. _8 T/ N# Y7 ?
  
6 c* D! f5 [$ }( V  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
8 ?6 J% M6 E: w* x# O- d! j0 J  
, R' R5 `5 U* n$ m& u  -n count Number of echo requests to send.
, @7 K. h7 C* N' u' V7 c) q  
, p4 c( M$ Y  [! ^: h: x' G5 e3 ?8 U% e  发送count指定的Echo数据包数。
! V# d9 r6 F7 A! j7 i+ C4 d   ( `3 A% [9 q$ b) R
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:   M8 A3 x% g1 i1 A4 t* E
   + z# m  f+ e5 J9 M
  C:\>ping -n 50 202.103.96.68 ; t3 ^8 W$ h: H# I2 M- B
  
! H) t3 a* A) Y" q& H  Pinging 202.103.96.68 with 32 bytes of data:
% @3 y  T4 z. K% D4 _   . K& t+ K1 ^9 ~- r, w9 M+ |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 c- a2 |" ?0 n5 {
   " C8 T+ d  X# [# n" K
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; T9 X: B5 s0 f  
+ X* J' B) i9 A+ o! ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # Y- O  S5 _4 @
   . l8 x' G. R1 B; `5 U
  Request timed out. 7 N1 R; B' t9 \, `) \' b$ T
  
. W( H9 V9 i# S% V. `! S, l# j3 [  ………………
; J9 V1 _3 u# n/ k7 C  
/ a. R3 O( a7 l$ |  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; M$ l- y) G9 Y
   4 f( }2 o) g" G6 S/ t6 Z5 \
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& Q( d8 q" p4 T. @2 t4 G9 G   - J) K8 p2 l% G# ^0 L  B
  Ping statistics for 202.103.96.68:
/ n3 ~8 [9 I3 {' P8 E5 ^- ~  
; V8 h/ O# Q8 e0 Z6 Q( a) ]8 x/ f  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
- K$ y" a: I* a1 h* p' L' H! Z   " R4 u" H5 G7 }  r+ k
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
5 h5 y2 z3 ?" h3 ^' M% J  
" t6 g: Y! T/ ^  x. s4 {: z  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
1 ~7 u1 U! |3 V6 }3 g* A  
- l9 @7 g% J, V8 e0 g  -l size Send buffer size. ( |( R( v/ ?& c
  
# s$ i9 m5 m# Z  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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