返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 6 H7 S  n9 k7 w% W! d; \
  
8 @5 B; E) v& s4 W2 [6 `4 m+ _4 D" ^  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: : a' f1 _  x; }" {, i: d& ~/ r
  
, b( I! x0 G2 J  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 w4 {9 D7 \% P% q* S0 v
  
- ^4 d! O1 [) S  H: S+ N  Options: ; e, ?: l; u) I- {
  
+ r/ m# h! S6 l9 U' u( g  N4 u  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
4 r6 m$ z/ |( u5 X$ N   ! c" i6 p7 ^! R8 j1 p/ y! D
  不停的ping地方主机,直到你按下Control-C。 * X4 N9 `9 L2 t6 ?; `6 g- X" y  u$ `/ x
  
! H/ Q# L1 J! A+ G  a  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
0 B2 R* n3 Z9 ]2 i% h  
2 l! p: A' @. N# D  -a Resolve addresses to hostnames.
% E- E: m9 R' v/ C) N& q( ^6 n- o   4 Y5 h0 ]. j2 ^$ A& |
  解析计算机NetBios名。 6 G8 k) t$ _9 [
   9 ~& \  }; Y& A3 t) ]6 ]$ w
  示例:C:\>ping -a 192.168.1.21 3 W( V: Z. O& I& b  ?& g. h
  
( O% {: U9 C! B. q7 x& C) L/ v  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: + Z' p! a) r. s3 S! J. W: Q* P. L
   . b6 e" g3 c" t. ?  _. ^4 _
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 ~: n8 s: t9 A5 y
   + {  R' g$ B) [. h. I) ^8 e# G
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   d" x2 q5 u( h" Q* q7 `& I0 L
   1 C% Q. a8 }1 ?4 C( F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 d& a4 R$ Y1 _
0 A# U4 f6 H3 [4 L2 ^  
/ Z( Q- [# O0 n7 {% Y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 |# q! w7 A9 M* Q  
1 n) \6 T  ?6 L3 l) [9 d6 d  Ping statistics for 192.168.1.21: 7 F8 y' T  _) K0 P0 ~4 _' A4 e$ G
   9 }, O0 F6 a& F8 C
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
1 m9 P$ a  q: R  ^5 J4 ]1 \  
: \* |- ]7 }! ?4 o6 }$ `% O  Minimum = 0ms, Maximum = 0ms, Average = 0ms
4 W8 m7 h$ U7 g+ _0 N% \2 s   7 s3 Z2 R+ u  r. ~
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 + r" D; g! U9 N# u, t# g
  
1 j7 F- }' |! i2 a: t( N8 X  -n count Number of echo requests to send. 1 j1 r6 Y/ C. x- w: }
  
0 C, p8 _. b  [" U) O7 c; o7 r  发送count指定的Echo数据包数。 / k5 O. z. @" R$ R+ y5 M" T
   / [( b: N1 R' Q. Z
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
5 v* [* g1 @! L   7 D' E- o6 l; P) P3 D
  C:\>ping -n 50 202.103.96.68
* ?1 U# @, B. V6 l: F0 Z3 Z$ a   $ Z9 Y! A! r5 Z- H9 S3 x- c1 M
  Pinging 202.103.96.68 with 32 bytes of data: * k# T/ B' p) r6 P( {. F: Y* Y& k
  
  m. \: d: G6 G/ s  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 N5 x2 P7 D* n* H+ ^! a( z: V- D   4 J3 ^' A; q+ _/ ?+ d0 u9 L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , W$ s$ M2 A0 u! w& {2 U( r
   . G1 A  e! [, T/ Y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: ^3 Q; Y  y* A1 \# o* ?9 g  
4 D* N6 F$ d$ w5 ^3 L3 V, i  Request timed out. # f/ a6 e" @9 N7 Z- `' d
     K5 Y9 o( l+ S- d1 t; x& q
  ……………… 6 V* A, c; B0 V/ a9 _7 k
   1 E+ _- r5 ~& f' L3 Y( g$ v; r
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 w4 u  o3 P% E
  
3 c+ j5 [: d- e7 z- {/ ~0 x" w  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 u" x3 \! o9 |- B. `$ C) ~3 H
   / y3 m( ^) c1 G9 U2 r6 }* c
  Ping statistics for 202.103.96.68:
) \: k% f' ^  I  
) p; `4 u. ]2 y3 x/ F8 @) B  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: + N$ H/ K: H" z  w5 l, g7 q
  
7 ?7 E- `) x& w0 w- v  Minimum = 40ms, Maximum = 51ms, Average = 46ms
4 Z  A' @, D1 j+ }   $ N3 ^  R; J( k: k
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 + ~' f# I6 ~8 g/ S3 x- G4 _
  
; x& A2 t8 x5 C7 y# a* Z  -l size Send buffer size.
/ V7 a( [0 e4 _1 W& Y/ q2 z   0 _# Q2 c, j& ?! M! q: b
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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