返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 & W  Z, h* R. D
   & P: J9 A% ]4 h! G5 d2 f
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
- L4 S- q# m* E6 {( X' e   4 ^: D! v0 D: K" o* @# ~0 z+ X
  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
" A) {. T9 ^' C: e  `   0 y6 K1 p, l3 f% E8 Y% b& K5 `& t
  Options: " x6 u  A* d3 J7 q
  
6 s  S5 a4 A/ C  Q8 K( V  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - r0 G0 @3 O- s6 D1 C/ U  i' ]' d& _
  
" F( ?  t" {: d4 B. |3 |9 X3 J4 W  不停的ping地方主机,直到你按下Control-C。
( t$ C7 R. g" s   6 U* u  |3 s! N5 Q* A9 x
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 / E+ J" o3 j& e, S, M) J
     l& X1 l: G4 t* |9 g7 N1 @5 r7 \9 Q
  -a Resolve addresses to hostnames. ; J; c4 g# j! e& `
  
9 l) ~/ v& `* x1 ]0 f4 }9 \8 A) M: j  解析计算机NetBios名。
& e6 ?9 P1 l* V9 e/ `$ U2 ]5 M   6 Z' ?6 z! m$ S" I# K9 D
  示例:C:\>ping -a 192.168.1.21
( B2 Z3 L$ Z/ c+ }   ' E0 a3 E2 B7 p' \" L# j. z
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 s% u- v; _5 \- Y! a# R2 J. C  B1 o   & _! z3 h/ u$ ]) C, j3 B
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' p( c4 Q; |' c4 ]& k( w+ n  
. F# ]% \/ f4 X9 A0 I  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 `1 b/ S2 ^) Q
   1 K; T; D: V4 L8 V) p2 k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 P! @2 s9 k6 c9 s3 c0 M, x  E5 t
  
2 p& R' C# C: _( x. g& l! V  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  g1 a0 [9 D, ^* M1 N1 `   # p* I5 l& F' y3 X3 ^* M) E2 Z) z7 O
  Ping statistics for 192.168.1.21:
5 w% a: p& c2 H; b- t7 ^" D; i   ! g2 b8 C6 q* d1 k) B
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: / ~3 Q) P4 V7 W, v% \8 i4 i
  
* R1 r5 ^* j5 H; k- L  Minimum = 0ms, Maximum = 0ms, Average = 0ms * L4 |! [. z# Q# B, J$ h' M0 y
  
$ _' W( i5 S% w6 R2 @. a  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
) V/ G+ S& V% b8 s& C$ n  
; r7 Y7 `  h, g- J  -n count Number of echo requests to send.
6 Z: f; R5 h" T   5 ^8 V, }+ ^- B& z
  发送count指定的Echo数据包数。 ( ]8 o9 b& B8 B. Q' e! t
  
$ M) Z8 V" V5 }0 A  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
# H7 r3 ]- t, g- f. L  
+ v/ O) W7 p( `+ C6 [' J5 A3 V+ N1 d& p  C:\>ping -n 50 202.103.96.68
# G' `% @- a! A: P' ^: Y1 n# K: w  
2 E3 Q' P" f, q* y4 z! Y4 Y  Pinging 202.103.96.68 with 32 bytes of data:
2 o  R3 p; f, d' }- u: Q  
$ B2 D  c9 b* T; p1 U  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 w, v$ G6 @* i) O0 c9 U
   ; F. v, Z  m' k( p  Y/ j+ H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; s! N( @+ ~% J/ q2 E   0 a8 x* `' L5 U& m5 ~7 k4 O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" p( P! ^8 Q: J' K2 Y  
, l, q3 H/ ^/ z+ ~9 O3 \; }  Request timed out. + ]) I, |- b4 |  I# i) Q9 F5 `
  
# ]! V- Y- X2 y; k& C8 V3 [* T0 W  ………………
) j9 I3 ~# K( @4 {2 e4 l2 D   % b& B6 r/ J; M  o
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; Z0 \/ O9 l. k
   4 S: {$ e  q9 d, C1 O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 p2 [7 Q) U; k+ w; M1 {. }
  
8 ~: n8 `5 P  e) Y( [  Ping statistics for 202.103.96.68: + M! R4 H- s6 a* M/ t
  
  Z" G9 j8 f. _; ~  D1 ~  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
8 U( n9 ?) k0 V! ^   0 W; P. s! b0 D5 `- H, l
  Minimum = 40ms, Maximum = 51ms, Average = 46ms   p, m4 [1 w3 O' C$ i
   3 U8 V1 w: o9 X3 K, ^% Z3 o
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
2 [( }0 y: a9 S9 a1 V2 ~   - s$ l, K' ?0 d+ X+ g- e! U% N
  -l size Send buffer size. 2 r& W& k. O, q( q# T8 _% j6 G
  
. I' W: f  i3 B. J" u9 w; Z  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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