返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
6 v* T& C6 k0 p% d# b5 _   % L$ }5 p+ o2 p/ A* a. k
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
, e9 H8 U- c! R' w7 ]2 z2 \   + r5 N1 s/ X% ?" p% M0 S
  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
) p- @/ z. V9 `' F   ; f+ S" F! ~8 m/ t. ]
  Options:
! Q+ _  C& |! i5 M9 y   * @( K5 K) W, k. h2 Z* S5 F1 ~
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
% |+ P0 J6 q/ H3 X8 k$ o* d  
( ~7 R; a1 ^2 v! D$ j8 B/ b  不停的ping地方主机,直到你按下Control-C。 : ~. H4 C3 E* r: v4 T4 q
  
# E% @' E5 G2 e  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
+ L  Q: d) f" X! m0 i( I   $ E" N' n+ P! r$ U, `# |
  -a Resolve addresses to hostnames.
" T9 y% e( J9 R  v' _0 d) I8 F   ( `$ i$ k+ q. |, ?6 B# o
  解析计算机NetBios名。 ( R- v- W# c7 T* @( t0 Z2 D4 q% ?/ Q
   8 H. w2 k/ G; t. v4 R9 C
  示例:C:\>ping -a 192.168.1.21
6 j- A$ K9 a# p0 D& T* W0 t6 E   8 d( Z7 V+ X2 p5 V
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 O, T5 v2 Q8 o$ I4 \/ g  
; `6 h- \5 H7 ]( p" {  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  l, w" s" Z# ?% K- l0 n# u. `  
. m7 l: T3 A  @% y/ r  B  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / t) m; L* s1 _- I; d' e
  
8 g& D9 f6 ^0 o. E, M+ ~  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  t5 p& m. g7 q& s. u) `, n/ G/ x2 |2 f) r, u* o
  
& i; D5 F- q7 b' e% T3 l# J1 D! ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% R* {) s, i$ J  o! s1 }/ s  
, e2 y$ n+ G: ~, U  Ping statistics for 192.168.1.21:
" h5 Z/ Y8 l3 e5 @- ]) g" f' p   # U+ M% G$ L' k* R9 b( [% ]
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
% [( p+ Z5 _" p& O2 I9 A3 }  
7 F5 A& T# l( e" ?( D7 r2 L) {  Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 B" U! m4 e0 T! G* k; I" V3 u
  
5 Y- O* ]# s; y8 `  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 * n% u' l! v. s
   6 [$ w* k% E5 f: f- V! a
  -n count Number of echo requests to send.
0 G+ i( f+ Q2 `/ l   7 t5 r) F0 }9 K9 E# I9 s
  发送count指定的Echo数据包数。 & g$ c) k+ b& C
   : x# j& Z+ S$ I* r2 `" P* I3 b' O
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
, J1 b+ P6 j7 r7 Z6 w  
7 A& Z2 Z5 t' R. Z9 Q  C:\>ping -n 50 202.103.96.68
; ?( e) P( @1 s+ n$ T5 h   * l& y( F% m6 ~: u
  Pinging 202.103.96.68 with 32 bytes of data: 8 N. K% F% J) X4 I
  
: e1 y4 Y# \, q; e! G: j0 L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 q' `3 u! |% C9 B7 b& C5 }  o- \  
+ \: b- N, s0 G7 _4 ?. \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, G, q" C0 S3 W5 a0 l6 K& t+ U   0 A8 [& Z" m7 z( c0 e) I
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 G( D: P5 u4 [  
' D) f9 g* m6 s6 X  ]5 g, k3 s5 Q; f  Request timed out.
) M/ b5 h0 ^, }# x* p7 Q) `( ?  
4 f2 F, f/ _/ ^2 N7 Z! S- p- c: B% a6 h  ………………
  o+ ~8 L3 c6 x6 x0 b2 Q   * \, e* y" O6 z# B* ?" h# a
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, n3 [2 G. W, I; `% i9 q) d# E   # o) a* x" I2 P' q% r% B* T1 A
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 M- e! `; q& P& R: c! M
   & J2 x+ Y" n3 i! X. c" V
  Ping statistics for 202.103.96.68:
; v& H' ]4 U& T& b  
' i; h+ l' D# f  h) s/ B: G  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
6 i! K0 a% G1 h. R0 T) i   ( q% A6 }' M( O% I, N
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 B: g  S" i8 c' L8 y
  
5 h! E/ j  I! P9 x( z  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
# j6 C8 O; A6 N' a  
. |6 X. i  F( J. [$ w3 t4 f5 `/ H% ]  -l size Send buffer size. , K3 W9 C7 Q+ Q. e1 h, E! g- u0 c
   1 @5 z6 S* z$ `* l! d( r
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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