返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 5 ^: b# f: _$ k8 z
  
& T$ y3 h2 k  d$ D' @3 B" g& @  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
$ l. q( ~$ \9 ]8 _$ H  
1 W+ M  E! \! j4 q  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
6 I! j, I1 {( G/ H* ^+ J   0 D  c7 f( Q; d- o
  Options:
) u( p' B/ |7 O% Y$ s  
. O) ?  G  E. `. ~+ j: ]# y$ ?  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
, m8 i+ _+ j  G( t. k! K   2 J2 ~# c  S: m4 J  W
  不停的ping地方主机,直到你按下Control-C。 7 p: B" f: L  ~3 U5 @+ E  L
   ' R# n4 M5 ~& M/ d7 q; p. B
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
0 b2 n2 c, ]4 }4 k: ^  
% d8 ?  V6 d/ A* v2 S  -a Resolve addresses to hostnames. ) }7 P" v. ]% a0 e2 i. f
  
% |- k, f+ R9 h  解析计算机NetBios名。
+ E/ T) N* ^  v3 R- {! H  
! [4 C! o4 m$ t  示例:C:\>ping -a 192.168.1.21
$ u, C) X7 q! h- P5 V   ( a& }: o; Y, Q! F
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ! c# {: r3 R2 Y& L
  
7 j" F1 m) a: r" S$ U6 P6 Y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: _8 v9 Q; m* F7 Y  N  
) A' m# ]0 U0 A" m3 h  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- w$ G' n7 u) V, j8 g! ~; V- I" z  
& m) [' n0 o; I* p3 k! t  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : [/ ^7 N9 b& u

! q3 G; g* C  N8 m3 I1 Q: l   4 `$ {& f5 M/ h* b6 l% M
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 s# `) }$ r. Y, o/ O. h% U  
' O  V$ ^( T. Z' X$ V3 z( Y  Ping statistics for 192.168.1.21:
, d  V% o8 {' P7 s   7 F" S' u8 Q5 G5 Q1 \$ z$ w6 D
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: # e. U$ v4 T- Q& {; w( S* V! E
   9 a0 f9 j5 B" G* l/ W  _. f2 ~
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
7 L0 d# y6 x, Z0 T! K% ]  
' c  O  U0 k9 f; X, Q: G% r% K  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 , c1 [0 E+ L) J9 p
  
1 j: n6 F) Q9 S( v! _  -n count Number of echo requests to send. 3 S- s; h6 z3 [( j4 t! T1 w9 P6 |
   6 ~& M  ^) @+ r9 Q; p8 f$ F
  发送count指定的Echo数据包数。 / Z) G* \' I& k1 w  [% q: c
   6 v* H7 _7 t( ^; S! ~
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: : K, X; S, z" X$ [
   ! Y7 z- J& Q: F4 U9 F
  C:\>ping -n 50 202.103.96.68
! G4 D! R  E) p) E9 q  
/ Z. y, I/ C% n7 D# \+ i  Pinging 202.103.96.68 with 32 bytes of data: - ]- l1 c% K% x4 }; e: \1 I! y, y. U
   - V2 i6 n& s4 \* O7 L3 m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: |: p$ q$ L3 W, l1 W# C9 f  
. l9 `: m6 M$ r" G: D0 l  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ v1 a+ y+ K9 g6 c" X% ]   5 @$ v( k& ~  S8 j% u
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 w) N+ S' p" @
   ) H1 O! L2 ~" i! p  X; R1 w% a
  Request timed out.
& p6 C- a, S  K% k   , A: @! \) K' T2 t2 \. i4 c
  ………………
2 r$ R- m. S4 n" B3 t2 ^2 X) n   % m! k. Y" _) n6 M0 Z5 g6 r
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# k) \. Z6 o0 f. g- B  
1 g4 d7 s1 ~% n( e* s( h; s  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! ]0 v6 B7 B2 z5 o% d
  
' F  x- y, h# f  K) v5 f5 y4 s  Ping statistics for 202.103.96.68:
# H! T! g$ V0 w& O6 Z  
9 _% U7 W! u+ G1 C) \9 |  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ( p3 a" P6 ?; r$ G1 B3 v% B4 s5 K
  
9 X2 E. k5 e9 B; s* |, \2 P0 R  Minimum = 40ms, Maximum = 51ms, Average = 46ms
# K+ q5 H# D& h$ e2 l  
& j$ }1 P5 x$ q2 d7 J( i  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ; j: N  E4 N5 c6 ^2 q
   1 B( {) [, z" E: P0 M, L4 f% V, _
  -l size Send buffer size.
; v  p3 x, I" K, f, X  
- M6 B, i: t5 A  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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