返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 4 j$ v# S4 C1 r* f0 s3 r7 ]
   8 I$ i# [2 \& @, C" F; h( m5 u
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
$ D) _3 ~) Z2 G  l+ J' F$ r: d' e. V   ( W( K0 U/ w6 {+ Y
  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   e1 m/ X# N0 }1 G" M7 e+ }: @& E2 g4 Z
   6 E4 L, E3 N" p5 V" C" \# |" K
  Options: ) `# x# C2 D8 X/ H& k
   ' q1 S7 i: Z* w  k: F
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( u9 r5 W3 f( C2 @$ ^& `! j' V/ m, v
   6 N+ t- @, Q6 S# ~) |
  不停的ping地方主机,直到你按下Control-C。 " H! `8 E% @; }& z: x( p; p
  
5 X7 g9 {6 ~, {+ s$ m  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 8 B5 i& H& }$ b: G- i! g" R( c; }
   1 Y/ R7 C" I8 b  m- K$ k% O. }  t( l7 Z
  -a Resolve addresses to hostnames. ' w# m1 x; v( F- M
   5 L% W( Y3 y9 _# [0 }9 X$ }
  解析计算机NetBios名。
2 P* O% c* t* L0 X+ b, O+ c   ) q" ^+ |* s, w" t6 g. A! M
  示例:C:\>ping -a 192.168.1.21 / R) r7 \& }  y- n, C
   , _5 J  z4 X- F% B4 s  m
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
+ d" n2 Z5 q, j/ t1 O4 a   # J4 |% t3 n5 H( _
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' w. b9 L! p. O8 F  X  
0 p! T+ V2 Y$ V9 [  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - e1 i/ v. ]1 A0 w+ K6 o
   3 z* r  [/ R( U1 G1 {7 v6 Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " ?- e3 ]- |$ L( J5 I, Q' D

) m$ Q8 Y7 T" I0 H+ s/ J  
) }9 p* Q7 F& p# u  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - K9 P' k. L9 H% V) X3 `6 R
  
' L8 b, ^* f8 e! |  Ping statistics for 192.168.1.21:
, g: I5 E% t" F5 S9 Z/ K5 k- V  
' P6 t& l% _5 h6 U  p  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 7 }* k1 N7 L/ Q4 ]7 e
   2 U8 ^: a' p+ \2 z- e: m
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
7 K* \! i8 D1 l" o  a: u: E   2 J- g2 x- B# y& W
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
1 S/ J, V6 B8 o. v+ F, S2 E  
1 H4 M$ i1 D, w  Z: q; P' |0 k  -n count Number of echo requests to send.
( c7 @: h1 u. G   , {( d' p! q) V- @7 E9 M& m: P
  发送count指定的Echo数据包数。 $ g7 ?7 F  ^" m  L- F
   $ M# }. n9 W3 k% n
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: * Q8 |* T+ ~: G! S. W; N
  
0 S% f3 [( J. X1 U# o4 p0 H  C:\>ping -n 50 202.103.96.68
3 t1 c! S+ T3 E  
) d+ v" X. o( j# |5 F  Pinging 202.103.96.68 with 32 bytes of data: , M& T% ]! b; R& {+ ]! ~% `3 t3 [
  
' U' v9 K3 T+ y, B' Q- s! C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 _0 |5 j) R- e: c   5 n: s$ O% @7 N5 L) I  _. j* O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + l% y/ ^+ K* O, N5 j" ~% ]; m
  
0 w. j+ ^- V+ r- \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 j/ p+ [7 T% }' h
  
9 h- X9 G4 q# c  Request timed out.
; R' z. \1 `+ h  F3 C+ ^2 W  
9 Y% v: \2 [4 c- J  ………………
9 ?: d: \$ ]% |+ T   % \$ k. U. H- A( v
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 h& O3 C: T9 _0 e- B9 b   6 |* a3 }( `. p
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / ^4 u% N' _% r, @. F% ]
  
; a+ i0 g0 f( }  Ping statistics for 202.103.96.68: ! B' `' ^4 V6 C- a, k3 l, ^2 [
  
* l7 Y6 S! i( ], P6 @, \  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ' S6 L1 A' l. G: @/ j  x+ R
   ' m2 m2 g% A- W3 {
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
2 N' ]: L! Y$ e0 L% t   1 ]+ f! S' z5 a$ b
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
! r& u* J/ h7 H+ B& ?  
8 @% @. j" m$ Y. f. T4 V8 s$ q3 O  -l size Send buffer size.
' x4 z, h7 H4 D7 u# _1 h, s  
, Z$ q3 V7 o4 ], ?4 A  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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