返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 9 x2 Y6 y' ]$ E9 B. t) N5 }/ m0 l& Z
   , Z3 P1 x  X( I
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
$ p8 B- |: z* K4 o0 i- I6 {- u* N   . o: r- }, z( u. ]/ Y' f, T7 A
  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
5 s  C- P1 V) z   ! H  ~% G, [) N& X# f; ~$ ~1 t
  Options:
; i* a, @5 u' v   & }. l+ ^  q( w$ z  F. i; G
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
( K& ~# G) \* D+ d1 l( X  
4 ^9 Q* W  t6 R, z- s  不停的ping地方主机,直到你按下Control-C。 - [4 y! i6 b* @- b- U" K2 U$ J7 B  {
   7 X& l% v( l' Y; x0 g
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。   R% T3 z( _0 ~1 d- U
   : C; ^9 i/ j, X, x1 C9 J
  -a Resolve addresses to hostnames. " P5 ]* u+ B' ~# r' Y/ n
   , k/ V, c7 S, G2 i9 w1 D
  解析计算机NetBios名。 " O) |6 a7 ]. |/ n2 T
   : B" ]/ x/ S+ D) f+ F) P8 j
  示例:C:\>ping -a 192.168.1.21 3 u  N: i  k4 @
   : ^6 T# g0 k* e4 q( D7 n) c
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
# h5 a) M0 h0 T" S2 T6 H& A. x   - w' o# |2 G( W' x3 N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 g/ d. M6 V+ I+ m) G   ' s1 E. t# B* W
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ T5 R! @. k, ~   8 }  `/ _3 @* ]
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- d8 X; P. ~/ q  U% A. F9 l
' t6 v! `# L  m& L# c' M/ ^6 o4 q  
+ B( U; U, b, \0 d: L  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   e, s7 q! e' |1 V: @
  
( P8 H4 J9 I# Z4 {! Q& S  Ping statistics for 192.168.1.21:
6 U9 D+ m: u- {" {2 [   ) e/ @. l$ j& R9 V" ?1 G
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
# G4 Y! v- E* E+ A$ _   ( X* v; j6 \% x0 {* H, H# r$ j9 S
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
, \" ?) u6 N" G, O( E+ U   0 m) R$ ~6 ^& y% _
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
- a9 p: Y" [5 ?, r) c  
3 V! h7 c$ M. z3 V- B  -n count Number of echo requests to send. & y* k$ ?) k& t
   7 n  }5 R" P$ J2 V  K& W2 @
  发送count指定的Echo数据包数。 1 H+ L% L' w0 ]  y6 o, R" K
  
8 ?& {8 j0 A* N/ X# p# T) ^  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
' k* P6 t8 }& @. y7 G8 D$ q5 W  
8 r$ q8 s9 Z! y  s  C:\>ping -n 50 202.103.96.68   d4 ?) Z2 S* `9 l3 A: v. O
  
; `$ y6 i) [4 t: E% L" b  M% A1 M  Pinging 202.103.96.68 with 32 bytes of data: & x6 C) {  V& w4 U* n' G
   3 G* J0 s5 d% j8 O- a  _
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% N/ X" Y8 e2 L  
4 ?$ x/ p7 O9 V. L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ w5 c- z- G" Q
   9 a' f6 C  ~2 Q: B& i0 r$ Q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 ~  j* e4 ]6 X
  
+ {7 g( g! i7 ^5 J1 z  Request timed out.
  V# c! d* i. ?  
: e# ~3 l( i1 w) ^  ……………… 2 G5 N8 }4 W6 v
   ; N( s* J  x; I
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' ]2 ]1 R$ N0 f/ S, w+ h   9 S6 _  o" w+ s
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ F5 ?4 t3 n* R8 Q! ~% z$ K   & ?+ R( r+ D: `
  Ping statistics for 202.103.96.68: + h! }4 E& U3 y# C
  
& V1 R% x1 M+ ^) X2 h  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: & X. t( k- n: f& ~, J+ d8 O+ Y
  
# |& q# ]# _. V9 [6 r  Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 C" O" q: D1 N, ]
  
4 D. R; H: a9 M% }: X% V9 a  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ( r& ?. y/ ]& Q9 @8 D) y
  
$ `& Z6 {( j" U( D7 v! L  -l size Send buffer size.
4 K" a- G5 s0 ~; r" x+ r/ w  
  e" @# J3 B1 n4 Z: k7 L2 {" I  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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