返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 . S4 N! `6 |4 T+ [) U+ S2 G
  
. t" m- d) o; x+ N8 E  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
" _6 b9 c, R$ r, Y! P0 u   8 ?3 D! k4 F' h0 Z; ~% d  q& H
  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
+ u* g( u5 h! k( c! ]) h$ d$ [   * h' m2 H' @/ h- g
  Options:
9 c% q7 J: w1 q7 i2 l   0 |" I: j2 E  {" i0 z
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
* m( C# ^' x1 B+ I7 G   8 Z  s, \, J  K4 G5 A' S  \. {+ l
  不停的ping地方主机,直到你按下Control-C。 # @& X8 G2 x: A) ^+ E
  
' h9 t: s1 E, s+ h  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 8 b& R  G3 L7 l$ T7 Z
   1 n( @- Z2 \2 R- i
  -a Resolve addresses to hostnames.   _8 l( N# I5 ~* H
   1 M% \3 e$ M( D$ n8 P
  解析计算机NetBios名。
' W' Z$ ]" \9 c  j* a- s  
% g$ t* f, h" _6 B  示例:C:\>ping -a 192.168.1.21
' M5 y2 Z3 ^; l" M% ~$ }9 X7 w   ) P" B8 p; J4 E4 Z# q
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 7 }& Y9 u% S2 n+ F, ~& \" }
  
+ g# }9 p7 W" Y6 C3 ]' D  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" x7 K; d8 x% m( j" @   : ?- |( S) c! \, h  g# t$ C
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " W# [8 @  Q, F* m% j2 k, b
  
( i+ F; c/ H# L# Y$ _* b" r  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % K* j; s( F# r
" H5 j6 f, U# o2 V: [
   - |/ ^5 U$ s! k- q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : ~. K6 Y! I# \* C
   / x1 Z( s2 @" z' c: X
  Ping statistics for 192.168.1.21:
' C+ G$ u/ F. ]  
. `4 X" |8 i/ e  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: % Z0 i* x5 q2 o, q  c- Z! V# T
   6 O& N- I% N* k% @
  Minimum = 0ms, Maximum = 0ms, Average = 0ms : o, i+ f- C' P. B9 v9 Y
   4 T% G" H; |8 G* {, p+ P
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 $ }4 e! i2 g% O2 Q) y
   7 w" \, o6 D1 a, ~; v3 w9 U
  -n count Number of echo requests to send. 8 B' K; G# c2 o$ }5 F8 z' Y! i
   $ ~  P: ?  i" y4 g0 P9 l
  发送count指定的Echo数据包数。
, N; Q: g! z( D* y' U  
8 e5 I( H" ]/ E" f  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
! t( R! ^7 _) R- ?  
% Y3 W# i( t( E  C:\>ping -n 50 202.103.96.68
9 w. I% Z0 W: X, t& e   2 i1 z: v" T0 `& F
  Pinging 202.103.96.68 with 32 bytes of data: 8 I& \# g% S0 P+ ~
   8 s( W4 _' |: V4 q: N+ C4 F
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. D, m% J% b$ {" F   ; l3 [' X- G& n1 o
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / h( J% w2 D$ p* d3 _
   8 d5 n2 C: j( z' v1 L0 O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: m. |5 }% E6 V   - I+ T- O. C$ c* b
  Request timed out. $ [9 U6 [1 M: _5 g  k. p0 }
  
+ g) U: {% E* s  ………………
9 G) A/ x. f+ U1 r0 [3 h- [: d  
3 N4 ?7 M3 X: O) \' \+ H: q0 N# {9 m  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 p* O8 O6 L1 R& Z   , N  }# |- g- S: a2 ]( v2 F, z. c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 R8 Q+ s6 @) K
  
( F8 o' X. L) @% [4 f3 Z  Ping statistics for 202.103.96.68: 3 A: Q1 i: L/ ]1 }/ x* l8 f
   1 D0 I& V7 w' K) J& |" U; K( f
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
2 b% o$ G5 K8 r" f5 ~  
) Z8 `3 }$ x# @* K  Minimum = 40ms, Maximum = 51ms, Average = 46ms
# p$ ~; s) s9 V$ ]) U   . _0 d* i+ c! b4 z0 T
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 * w) y! f9 B; ]$ z( x
     f) Q8 \1 E. J: [0 D
  -l size Send buffer size.
) d+ |# m  m3 f" B0 Y; T  
* ?' Y4 t. p% c: z, P" @8 r  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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