返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
6 C3 p2 D0 G8 @  
6 r6 m7 M  {" O0 }5 x  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 0 q/ A  h0 w, q, [8 Q. I
  
- B$ l0 I8 A0 M) r7 f  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
9 }) j9 Q. |7 k0 L3 y  
7 ?0 p' i0 s; m6 f: F0 `; k8 V  Options:
- F: _$ i# b) }. H   # R+ ?% ~7 G3 B% {
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
3 \  Y2 r1 V# A: _) I   0 B( o0 g: Y& S" X
  不停的ping地方主机,直到你按下Control-C。 . j+ |/ a% q8 R6 y; ~
   9 M$ P0 j0 h' T4 E; Y5 @+ @
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
( y. Z& M$ y8 M, j* R. _; d   4 C' H; o* @5 P! g
  -a Resolve addresses to hostnames.
1 G3 k2 Q9 n8 U0 v  {  
0 t" T; _) M0 t  解析计算机NetBios名。 . Q8 T! _/ K4 D; S8 j7 G2 T
   . [- C- ], N$ l: c4 @
  示例:C:\>ping -a 192.168.1.21 5 l9 j; `, N$ f0 L- f
   ' E" V8 P' R/ n
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
& W# s8 P  @! h  I" u, e/ H   " Z7 _2 W0 Z- e/ {7 f
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 A% G7 s3 F  J: X$ L  
# h3 z# ]  u% q1 w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 u; r% Z5 S3 `! a6 J
   ! O, a9 N9 e2 ?9 ?+ _
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& m8 e" P4 L  ?- P2 }1 ^& h1 d+ r; C$ O
  
8 _) |& s4 q/ e2 B0 x4 a9 t  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 P3 m5 L# D+ _
  
% e" v* x3 V1 \: a  Ping statistics for 192.168.1.21:
  t8 L; o0 j3 W+ X" f5 \" Z   ; J8 i9 Q. R7 e9 b+ R7 i
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
7 d0 D+ j% R0 D8 J2 z% n  
$ H4 f4 u$ S! Q: c0 A& C  Minimum = 0ms, Maximum = 0ms, Average = 0ms
) n. ]  F' b' s* \# `8 A   & r' ]( }/ o4 y9 |5 h6 Z
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
9 T( \& F3 A3 X3 c% f& j   # E3 p9 p3 W7 r6 j/ Q! U
  -n count Number of echo requests to send.   f8 y& Q" B$ J# O
  
  V" ]  [! T2 {  c+ a  发送count指定的Echo数据包数。
2 J3 Y3 m! L2 ]) ^   6 V' c; d8 a2 C7 G0 f
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:   z1 w4 r8 a% V6 |
   ! z* P' g7 N$ h; R# F3 b- z
  C:\>ping -n 50 202.103.96.68
% `/ L8 }; {% a/ Y* T. t  
+ c: C3 O5 P9 s  Pinging 202.103.96.68 with 32 bytes of data: . j0 Y( p# h! W9 D7 |0 H1 x9 I
  
- y- q5 \; A: h9 ^; K$ b' S  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 m* |& J' X! k& s: a! Y
   - T; v- ^/ H' a/ Z+ ^  z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ M# B- G( k: x. L+ F  ^  
1 ~, D! M# p+ \" }! Z. Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 ]% X" {! \( z  
8 Z2 c* Y% G. R- Q5 D  Request timed out. 2 m; c; [9 \. l9 f
  
% x7 s3 @/ U9 h8 C! |  ……………… $ P. U" R4 c$ P: ]6 P6 p
  
) j0 I9 b0 ]4 z/ g4 l& L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 K3 r! ?; h. z" M/ O5 Z, d; n  
4 l4 u' v' ~) M1 x( }& P  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 T0 ^* J# C2 e* t: a; A* }4 U  
5 C" H( L+ |2 a  x  Ping statistics for 202.103.96.68:
0 X6 V/ ~, D8 y- @  s7 V   ! z) B2 K+ L7 d( D  [! n
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
5 x4 _4 O0 |3 ~0 G$ ?' i" L! h. o) _   + b+ `; f; `( h) F/ ^( K
  Minimum = 40ms, Maximum = 51ms, Average = 46ms & ^' j6 F. E- ]5 C( u0 F
  
# x2 J+ M+ _9 w" @9 ]  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
8 H& M/ S8 f: |6 ]% |$ c  
9 L4 K1 _3 y( I) Q9 ~0 @) I  -l size Send buffer size. $ G) m5 V7 t1 C1 m+ T
   " }1 Q0 T- V" }) a, L
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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