返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
" o5 g  I! k, c; \     X8 U' r' c/ F5 C# q1 |
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: * e7 q. N+ Z; x0 I6 G3 a" l% ~
     T, D% }1 @" ]. W0 B' p9 U; R0 [
  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
$ f& C/ _+ f) Q   ! e; [2 Z  ]  U3 \# L
  Options: - ?8 O  i1 q4 d; {8 ?+ D+ t$ e
   4 O( V: n" ~0 ?  D
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
! y/ p* M  z) A" ^   3 P/ r( G0 M. u8 L3 }
  不停的ping地方主机,直到你按下Control-C。
  v% B! o3 }. e, ?8 _7 ~   $ p8 o1 i( n3 [' b5 n& k  N
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
$ w2 n* e7 `( R4 W: J/ _2 l/ H( Y4 [  
0 _: U9 u( X0 e/ \5 t" q( |7 x  -a Resolve addresses to hostnames. " f* O5 G* C) s+ ]/ U
   # i" z" ^; e" [
  解析计算机NetBios名。 / V; u$ n4 i9 b. ?, B8 k0 X
   6 T( k# Q& w* k( Z
  示例:C:\>ping -a 192.168.1.21 + m, s$ |9 S+ R: T# h) |
  
, m7 ~0 o+ s! }+ A# j+ ~  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 @" T3 C2 J( M) _+ W   ( }& _* x% Q7 x7 e
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- O0 ~& \; w! J) Z# h8 [. O4 p  
* o# u7 c* y; F  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # T0 r& p& y: ^
   : G$ D! u, m6 j3 ]
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ E/ ~0 Y" Z% C! w8 U- T2 t

7 Q, X: I; e+ @" L' g   ' ~/ t+ Z& O, @0 D; A$ o
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / L0 N) s. J# C. v' I9 C$ J' l# {6 ~
  
6 G# T: c7 G! ^7 q  Ping statistics for 192.168.1.21: ! m) T/ s; D, }+ C" Q8 v
   6 K( v9 [* K6 W6 D) w3 \2 ^
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ! ?1 p4 K0 g$ }, d/ w
   8 f5 \; r$ i. ?5 H- i9 k' ], R
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ' I; U4 A6 h) H' J4 p/ M0 \
  
: j; X1 k5 U5 A8 e: D- I  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。   I" j8 q# ~8 I9 k; ~
   & z* D4 w- ?2 d7 {' H. z, I2 V7 p
  -n count Number of echo requests to send. ( A, N; f' J3 [$ s9 |
   " b/ d. u/ s9 ]7 ~4 X, X
  发送count指定的Echo数据包数。 ( n/ h$ V9 e. i
  
( R% _' \1 y" e  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
9 e+ c; t, Z" R. m   6 s6 i) P2 k* E
  C:\>ping -n 50 202.103.96.68 8 y8 ~  m. e% K9 B, K8 ~
     f3 [7 a+ g' d4 n% O
  Pinging 202.103.96.68 with 32 bytes of data:
. Z7 `- z2 A3 u) I; x  
( X2 I2 ?/ u' T5 y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ G" H0 f" I3 w1 T  m1 N2 e4 b  
* R2 R. ~" o+ `9 H2 I# X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # ?& P8 ]6 l4 u; X, H5 L
   / E9 P- ~8 }' G& ?- G* ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 Y) b. P/ [8 s  
, ?& j* i) i5 {8 Z2 N- t  Request timed out. 2 p! j) L2 }# @
   3 q3 N) q! R4 W1 o
  ……………… " [! v0 \, `5 Y/ t. e2 L
   * @' |/ u9 |6 v# R% b; o1 e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* h3 H8 k+ B7 H. S/ @   : L- q3 z- y* g4 L4 L$ @9 m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & ^4 a+ w- S8 I% O4 b
  
; o# C2 y' }* z: c  Ping statistics for 202.103.96.68: 5 f+ x) `, e# L# j9 r$ m4 Q- T
  
2 q: |% A3 Y( v- Z4 F( ?' c  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
& S1 }# x, l0 }' W! ^; n5 ~% W: b   $ g' y/ |* U0 d' ~: Z0 I
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ) i9 n$ N! |  c, ~; f" t
   & Y6 l9 n/ I- s4 a
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
% R( h& D/ d/ \8 V5 A' s3 }     t8 m; L2 Q4 N9 l
  -l size Send buffer size.
( q. c/ q) s7 G3 L# D6 M   % I/ u" ?; V+ u- c; h* i
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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