返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 + V% h3 n1 n* ?" q: {
  
+ M( Y# a2 G# ]" d9 t' \: z  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
* `" }) h3 B4 A   ; v/ K6 @3 E7 A* ~0 V8 X, c
  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   }  L" h$ K( _! P6 i) A* z, Z
  
: @# h% Y2 M; _# ^  Options:
9 ?8 K+ l/ `+ R2 n* A2 n   1 _+ Z: e$ h# P" S
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
7 c5 [$ z. t5 A% G7 |   $ Y; l0 R. ^: H& J
  不停的ping地方主机,直到你按下Control-C。
0 v, s7 o' A; [7 U& {+ {- U   : B# U6 X0 y  ?& ]
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 d8 S' T' E3 O3 C& ~3 O2 e
   % u% [6 |0 ], B7 K" ?
  -a Resolve addresses to hostnames.
, N% H9 ?- k! @  z! J3 J  
" {; [4 I$ @0 V/ s, _3 F  解析计算机NetBios名。
) a4 l4 D5 i: V; c! d  
# U* i% V$ _9 Q+ H2 _0 {  示例:C:\>ping -a 192.168.1.21
5 v! `( r# m( `  
4 i  D. e. F  `9 u: n- l  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: - W$ ~* F( {, \3 r
   - w1 g! J$ k& X! u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: j7 e' f. K, K8 \/ {' U8 N( d# B  
  Y# x6 c/ k* D3 J+ \  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 b# t' |# ]/ p6 H  
6 ^# C. \, K( \$ a) [; ~4 |' I8 v  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   b6 C" @9 Y& C
+ p  M7 T. [% U: S5 |, ]
  
  H- w' Z8 z2 S  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * }0 o- e9 I4 D+ x; Y- w& m4 K" N! W
  
2 g/ p! h8 o7 @- h2 H  Ping statistics for 192.168.1.21: 0 w3 Q) ^' X' A5 T9 P# n3 X) b
   ! R/ r. n/ u5 J' l
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ) ~7 M- a# g% H; y* w
  
$ w! _1 [+ k* V$ ?  Minimum = 0ms, Maximum = 0ms, Average = 0ms
7 L+ {( ?" S7 _! `2 b   ' F( |5 ]* K' o9 n* C" l: ?
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 * v# F, d* s7 P7 G: w0 @
  
: n* p% b9 d8 [6 z8 z- f. h/ T  -n count Number of echo requests to send. # Y, v1 b; t, g) v/ R
   4 L: D1 K1 q& {4 C- Y
  发送count指定的Echo数据包数。 - n$ Z- E# L: z+ I1 d  c
  
8 h: @5 U. B2 u( ]  u0 m  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 0 I7 F, q  t# |+ l- g: ~& O
  
  f5 D% V; M  g4 X  C:\>ping -n 50 202.103.96.68 * i2 |# W, t; V- F
   " {; e  G' l% I, W
  Pinging 202.103.96.68 with 32 bytes of data:   T+ C% \7 Y, O+ g& h# e  V
   : M- U5 {& E+ \5 s; ]& c( |3 k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, a& q  q4 F/ |) A3 C. ]. y  
& v8 b8 x- s. n# j4 [& t& G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ r' O6 \! Q4 D6 T; _0 p( A3 c7 W- b   ) \5 A7 p" ]' z/ P+ X
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* b: {3 j& u- D+ \! h   7 t3 V- c* o, y9 _9 r' O
  Request timed out. + k+ G0 q2 q2 q
   4 \  I* C5 V: [: @1 o
  ……………… . E' [3 o* k: Z4 v
  
6 \3 E- t' V6 O  A& W( Y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + h8 M4 m: \4 Y9 o4 r; `& R
   5 M3 }4 V$ n; t' w
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + q) u( l- N# G8 p8 K" J
   # @5 P7 V. B" Z2 P4 V7 ]
  Ping statistics for 202.103.96.68:
, M! v: }2 @9 b4 B4 r   4 V( c4 L9 j- s
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: , |, Y' i3 ?# A/ E9 U+ m6 d
   % U, A# O6 ?4 q2 m# j
  Minimum = 40ms, Maximum = 51ms, Average = 46ms # Q7 D# Y; P. c: z9 w2 H
   ; T9 x" C7 `5 F& Q0 \$ b! e* x. _# |
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
3 M' ^5 T! F6 C- h0 n8 E- j0 I  
: L4 J( l. N6 ^+ Y: f" D9 B  -l size Send buffer size.
; l' H# W, I% @: C% Q% J& B# n   : \$ X3 V+ m( }& r+ n4 [
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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