返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
5 c9 M  s0 y; c7 ~  
3 Q6 ~# w  @; l( k1 v3 c3 I  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ! U, g: y9 g# Y- @4 `/ X& U
  
0 Y% b6 q. M* l, Q; k: d  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, D6 Y8 J5 s# ?. Q5 S  
! W2 J7 \6 i, W. p, R0 I/ t' t  Options:
4 {) X- m5 r, }+ [  
; B8 L7 Z% X8 L% h$ A$ H) @  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
% z& Y. p& {9 t6 Z. ]  
! \7 X- [" s+ e( G0 t5 o  不停的ping地方主机,直到你按下Control-C。 ) B, S+ `1 [/ d. E7 b
  
' q: O6 K- D5 ~$ x' O2 b/ [$ B  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " n2 j) n' r/ Q
  
& m& f1 P6 @' I+ X: `  -a Resolve addresses to hostnames.
$ `: C) f$ r- c  
! U( C0 M; w( |# C1 K  解析计算机NetBios名。
" ^: j$ b) ~; q3 w   : L9 h3 g$ H  {: k  `
  示例:C:\>ping -a 192.168.1.21 . N# ]# e4 {$ c$ e0 {6 Q# f$ ~' u
   3 I( }0 n  m7 [
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
, `& G) y7 _) i) s0 r5 b/ w   * Q/ u/ c* d: V2 v, J, y1 w7 d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . [' O: V6 ]$ O
   # B- \+ K/ Z) ^3 X: i! |
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ f! P/ R! g4 q- d7 `) i   0 k5 }: |. o1 I
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 a5 Q- J3 A; o4 e' C* v( q: h3 v

  L6 j+ i, T5 H4 D0 C' {   4 O: L* s$ x' B6 v; `# m+ ?! Y. O
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ z1 m; o: F  E8 v5 y1 r
  
, Q5 U/ M' R3 |+ b8 \1 u) k  Ping statistics for 192.168.1.21:
. Z! T# [. N+ ]9 d% T  
# A. h  X: a4 d. [' m+ X  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: % p+ R$ U  R0 s9 Q! R7 H, \
  
1 r7 m/ v0 K( D- ~  Y) A& @  Minimum = 0ms, Maximum = 0ms, Average = 0ms $ ?8 C& [0 R) |# m: P/ Q3 |9 g
   # V. N# V  }" J% G
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 6 ^) z; i$ B! r- o2 ~& Y
  
+ ?" O- ^+ a! B3 |/ F0 W7 @2 x  -n count Number of echo requests to send.
8 K1 \6 Q: i. @! `, r# p+ a  
9 ~! b9 x6 ~2 y5 F7 r" ?  发送count指定的Echo数据包数。
( @7 z( J1 d8 L- _. `: }  
9 J& T* }  W$ M$ k' U! r5 D  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
! E0 J7 T2 z4 a; S   % g' O; y7 @, |
  C:\>ping -n 50 202.103.96.68   r1 X' W: N! [+ J0 n) I
  
  P" N2 E$ K, m5 ~! L, w' E  Pinging 202.103.96.68 with 32 bytes of data: 8 ]/ T4 R( W9 M$ ^/ d- {" q
  
. f8 z6 I8 O* G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: F, O0 `& s' `* G9 [* _, o     m) A+ X' g  l5 r9 S: _6 Z0 H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / s6 d1 q0 [% L0 i- W8 N5 E
   ; a! i* z2 g3 Z- M2 Q. V$ G2 G
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: m& s, [5 P4 }4 _% _   . U! d% k/ Q2 d
  Request timed out.
/ C6 j" }, A" w/ g  
% u1 e  C. Q; K  ……………… ; T- @0 I2 A$ ]: V7 {
   1 d+ [6 [8 q/ Z' L2 |3 u
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & h+ t8 l8 R) d# g( q
  
, z7 F% ?& _! v! u) h) t  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# @) ^- W1 h. u# @* h9 a2 i7 R  
5 O" d$ Y/ \# y' C! y, g  G  Ping statistics for 202.103.96.68: / e: G" m, ^+ p" u" b
   ; j, y- [& L, z9 U( J. {. c4 K
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 0 N' W6 l4 u: D5 v) \" O- o+ i0 l
  
/ G3 E7 a( H' E  Minimum = 40ms, Maximum = 51ms, Average = 46ms
/ R7 p9 p* K- g  J' H  d2 T8 l   $ R2 Y5 U, j( p6 K0 A0 U
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 # p1 H- g( a* e! N5 M4 n- |
   4 |8 q3 \1 d1 f4 s
  -l size Send buffer size.
* H1 c7 K( F; K* r   $ y' w4 e0 X5 z8 \3 h8 [) d
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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