返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
' r9 j' F; m! f) ~. p) k. j+ W7 t  
8 {8 e1 U: ]/ |" {# `$ I+ W  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
6 C. Y' o+ r, t: s) l* d3 ?   - T; R! }$ ]& g, `7 r; u
  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
, s% L3 J6 X" u   7 W  ?: B) M; u/ q
  Options:
9 M% _$ X% m/ @6 B$ ]% x   2 E  x. s  K/ \, T! Y7 F
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
: d5 x+ `' F) Q+ t9 t" {6 F  
1 a/ N0 w' p) t0 N* Y/ w  不停的ping地方主机,直到你按下Control-C。 ) M$ E- d* M7 p- q4 w
  
* ]0 H8 L; ~4 s  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 0 x/ J/ q) Q, Z) w" A% L) m
  
. _4 f" ~; ^7 i& W7 S8 a! f4 m% c  D  -a Resolve addresses to hostnames.
% g: q9 L' v- H) D( \; m) p  
( h4 k  T6 y. I1 z* I" \5 g- u$ W  解析计算机NetBios名。 : g( i( x+ r% ~1 k, x4 ^
   ( ?$ ]5 i; P' j# ?5 R
  示例:C:\>ping -a 192.168.1.21 : R2 K5 I2 _* f/ w
  
: F' ]3 s+ o  s7 _9 \  D! J. e  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
+ R8 L0 U6 e( n  
/ X0 E! U. y. D; @) W+ I! y) @  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 m# U2 p/ j. J
     B! a' X% O0 l
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& o) H: \- S3 d( E$ g   - Z4 F8 x# _8 ~" W* X8 f0 x7 b
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; n7 X' _0 ^5 k8 U- f

; L; j% e: i+ M: i  
. p2 l, W. @$ _3 Y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / E+ V- W  p" P# U+ b$ }
   * V" a$ W. i/ H+ K6 y
  Ping statistics for 192.168.1.21: % o9 u- E# e6 R2 h9 s$ {( b
   ( N5 f( b$ T  ?: N7 |
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
) Z. L$ N. v0 O' U& T: r   5 X% e, `6 y3 t$ ?  |
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ; R: R) q; ^6 n1 T  K! }+ m
   + g/ }$ ~* }, ^5 F$ A
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 1 f- _0 `. E- q% Y2 L) ~+ A
   $ `4 f* U5 h) x$ b9 w) ^
  -n count Number of echo requests to send.
& ?# }5 `. A6 b5 R* m- j" d4 b9 \7 h   0 P: p- ^4 A; V+ W" Z
  发送count指定的Echo数据包数。 & E7 g' C2 O; a( K8 K5 d
  
; A, L( ^- ?) l6 w, i  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 5 C6 X# J1 h/ K
  
0 ^( m$ i; M- |% |# Q( n  C:\>ping -n 50 202.103.96.68 " C; h  [/ C: x5 ^4 |% F
     g% u2 `  D: Y' w8 t; {
  Pinging 202.103.96.68 with 32 bytes of data: % s# D- A. x" m+ k
  
4 k) P$ j% q* [% k  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 u$ i& ]4 U: F8 X6 v. d   - }8 k" p/ s7 P9 D+ l
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # M" G# |- p+ s( R: ?1 L
   ) V  V0 q1 H  K; N* x2 r, [' F
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + m  z$ @  u& m. c" ?+ g4 g
   , k& ]( `+ ?: Q
  Request timed out. # v% U+ X& Y, L
   " r- M" c( y' Y6 A' y9 z6 P9 @+ |
  ……………… * ^3 g" Q2 v* _8 Z" T* l
  
7 K/ d; {+ b" M; [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 j) d7 [3 T; q4 k3 t   5 J# T. c2 v# }3 k1 w$ W0 m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 M+ M$ z5 B6 n7 X8 I5 |5 ^  
% n! |6 a5 D5 W; `. u  Ping statistics for 202.103.96.68: 6 U& S2 z7 `5 F. r9 t
   ) l( s, b$ o" t& @! b% Y; e
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
! X; V0 `, u# j3 C: I$ |0 f6 w7 J, H+ u  
! N; i& v. ]4 W. L* C  Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 f% d. a( W9 @0 h7 l9 U
  
4 C: v0 B% e( F7 J. G# U6 D4 o! |' a  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 6 x4 G! ~: r7 V8 E/ L
  
: r- {" O( }) F9 S- g  -l size Send buffer size.
, N3 s* C( ?+ y; k  
, ]+ x7 h, }" U1 C" z  定义echo数据包大小。
89w.org捌玖网络

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

TOP

返回列表
【捌玖网络】已经运行: