返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
2 Z; s6 l" g/ J& N8 R" v: G   : D8 Z8 U- Y0 o$ O, _( k  W+ y/ g
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
! K1 d' d) a) S; |  
/ W! X4 Z: E& C& f$ C' m% g  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
2 ]2 Q/ [+ ?& Y9 m0 r  
/ Z( C* L3 |% Q/ M: b  Options: 5 u5 E. r8 k5 l3 ]! P8 B
   ( I/ X" o' l& l7 ]3 z" c. Y: E, n- d9 K
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( j/ q3 g0 W3 i1 M# Y- y6 K1 g
     b0 y3 u! l4 h7 y" U$ ]& F
  不停的ping地方主机,直到你按下Control-C。   ~5 n1 U( B  C+ B: g4 f% Q. E) [
  
& d! z3 z1 y! S6 V1 p" ?2 T  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 + t* |1 u# I: R( n
   4 E+ A! u2 h2 l
  -a Resolve addresses to hostnames. 4 Y7 [, g4 f. x6 K" C6 ~, I0 q
  
: _! t% ?, s/ j: v  解析计算机NetBios名。
2 i* f* e& p6 t9 ]( T* F2 s  
" b( _$ Q1 L5 S5 t' X1 Y  示例:C:\>ping -a 192.168.1.21 * E2 Y/ w* o) g) @6 ~! U
  
' m4 A, Q# p7 Y( e' T; U5 t( f  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: : I  P# ^7 n' _$ o1 S+ d/ u& q  E- q
   ( V( U7 I9 \6 a* {
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 l  E5 L- u  Y0 m
   , b4 ^! t& a, {* g! r7 ~" f) U' b
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) ~- c$ p! D+ y% ^8 [% v1 w: S' X
   9 W  |3 [! R& ~
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) r' L6 H( m1 c4 W7 [6 T! E! u
. r. M6 L8 P- D/ Y  {  
$ C  b5 o: t0 `) }' s  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 O4 j% a+ n4 E8 y  
& Q. C+ X( N8 [# Y! c" a  Ping statistics for 192.168.1.21:
! S8 t$ u! v3 t   4 L2 `+ c3 A. `; c7 U* x  q
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 0 G/ k& o2 ^- u1 D- h
  
% y# S; R7 B! G' v7 e; t  Minimum = 0ms, Maximum = 0ms, Average = 0ms 2 E( q* X! E8 M! ], F
   & ~8 w# d5 n5 h$ S1 m
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 # B! `/ l; ^; G; J3 C  i
   9 T; i, e$ Q& o) s3 I9 X/ {7 z
  -n count Number of echo requests to send. 4 J( V- I; o8 Q  n( W4 p5 ]
  
9 D% Q3 i' o( T, \) C  发送count指定的Echo数据包数。
! p' Z) \. b" |  
) T& [3 T& a8 ]' z$ ~: T( f! N  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: / L( U! P3 ?: w0 f9 S' o
  
7 u9 Y- u8 m3 Y  A) r4 P* A' P  C:\>ping -n 50 202.103.96.68 : {7 r- P. J! i
  
7 Z: b6 m6 R$ Y  Pinging 202.103.96.68 with 32 bytes of data: 0 a+ p' a! K! F8 `8 y! B4 d
  
( \4 R  M( X% \  D, E# S  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 A+ k. X; A- k  [! g   . K! z6 X+ n* o" c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - b* `+ O( a, \0 R* R7 t: s
   " G. U( o8 E0 f* n9 i
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 ^* t' C/ q+ b, [  k  
6 V! O4 _- A* ^+ d8 `  Request timed out. * s* W$ y! o+ o1 V' |* u9 i7 m
   ; ~; q5 M1 ]9 @$ y- T- L# v2 L& V
  ……………… ) K' q; F6 t0 `5 f! i
   2 r7 S0 n; `$ d+ w# M0 Q: b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 O6 M% h: B6 n# N7 X) I% B' c2 W  
  w+ ^# q6 z) m3 [6 u3 _) C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 `( [! K6 x0 ~0 o9 F   , g" B% @0 }2 p* `4 [" c- P9 {
  Ping statistics for 202.103.96.68:
- s/ q2 y  K, A) t2 \  
3 G0 ~3 p& n* t. m. }  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
% G* Z- E, w5 U" r  W. L# K' E  
' I+ `: d6 v! E- S) x" Z2 @  Minimum = 40ms, Maximum = 51ms, Average = 46ms : r4 t# h6 K) J# k' [; b
   " j6 t$ p( k$ J0 R+ ]4 y: r3 ~
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ( z3 a3 a2 N" {; G, C# Y4 o
   5 S( Z. ~, U2 J3 I! ~9 i
  -l size Send buffer size. 2 \' ~; @& M; A! {& [  w6 f. G
   9 D$ s+ d; x- _% ]9 ~
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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