返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
) H: G6 l, m, r3 n   ( f( r: M0 U, m
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
) [% @  J8 g: @$ w   1 w* u9 J& \# A/ M
  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 & S' U& k# u/ U7 x% d
   / q8 m) ~! H: Z, t3 \. Y3 r
  Options:
, |. N) a% H2 Z( P! q  
) J6 a9 N- Q7 n! r1 U- E  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
9 P' L' x/ a% o5 B, k  E0 N   3 f0 t% |" R* m7 U/ Y4 \
  不停的ping地方主机,直到你按下Control-C。
! [, f2 x7 G/ F  k- E   & s! M6 c5 p" W; ?: L
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。   R) l2 ]9 m% D; [; n
  
: x" o7 Z* s% {8 Z  -a Resolve addresses to hostnames. ! U" o! D' R" n3 W8 C
  
+ u' }  |; \/ r* }0 C  解析计算机NetBios名。 ) f! {5 P4 T0 B, T$ _5 j
  
, F8 Y5 s3 K) K+ X  示例:C:\>ping -a 192.168.1.21 9 Q( K2 Q; h9 P7 h
   " ~  m' L% E- K2 O$ n
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 0 C: ~; o8 C1 N1 u
  
" y3 H7 y# i$ g5 h' X5 a1 h( i  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" b" P' n- x; ]   ! E# n+ }8 V2 l9 V4 V& A0 t9 K; r; `. ]
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ b( ?! V! w5 n( @& |' V0 ~) H" L  
9 E' C" ?* @1 ~. P  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# S+ j  c& a/ r' K3 v5 u4 F/ b+ d8 \- W. ^% \- b, X; [
   2 ~  O- u. m+ m* L
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; O7 Y# q7 A  p
  
+ V+ V" |" q* Q$ ~% N  Ping statistics for 192.168.1.21:
% g2 |9 F% \# g5 O  H   4 [9 ^1 e4 y1 j& l% E/ e% ~
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ) h6 p( Z) x  M0 j8 _  B7 p
   ( b8 i8 `8 @0 s
  Minimum = 0ms, Maximum = 0ms, Average = 0ms + c% `& V7 Q- Q" Q" A8 h* D
     T4 F$ h# I& U% Q" p2 J
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 9 J$ r! `$ e, l3 w7 d
   & d0 z6 V+ _) U  @+ B& ~0 I
  -n count Number of echo requests to send.
2 }( w5 R$ z) \! r' p9 z  
( P" b( q; E1 e4 D3 r' m# `8 P  发送count指定的Echo数据包数。
- K$ }0 t% h+ a) G# T6 q, e  X" x$ H   ) \; {* R/ e6 `% X7 `
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: / C/ M9 F1 [8 u' G8 u
  
$ d, ^) o3 i/ x  b. Q3 ^  C:\>ping -n 50 202.103.96.68 2 ~$ o# F% x$ X# O  ~/ g
   $ ~; U/ Y& T: ], I5 `
  Pinging 202.103.96.68 with 32 bytes of data: % \+ T% T5 `+ b. z/ `& @
   ) U& l8 Y' z1 j" u+ h$ `  V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 K! e; u/ _% Y/ \+ t5 e( `   & U3 V' n- [2 ~) o
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 G/ K/ k1 |& ^2 |  
( u7 O! x& v) S" G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& D4 W$ ~8 T. x, R' a' A3 P+ k% D   4 G; j0 I+ s3 B( c  v. r6 w% M0 h
  Request timed out. 4 z) a" h/ W0 j; \! v0 \% l
   * Y. n3 W4 k; a/ t6 z' ?0 s- p% i; p
  ………………
2 I8 f0 Y6 f+ ~$ y& ~1 ~  
9 n( R% z" x  R  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 F( ~$ ]1 L$ [  E   + g# A* {( t6 G7 C2 H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + M" E' m( d0 Y& X! `
   * E6 @! }' Y, y
  Ping statistics for 202.103.96.68: / |2 f, y- D9 e) z" }7 ?* {: a/ i6 t
   ' |* }# z' A; L0 G- q: Y% F" n: _1 r
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
6 N) a2 l, [- C$ K" |! m+ V2 J   * N$ L* \0 y* }$ t+ F! v
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
& G# F5 T1 V5 [9 [# ~' [# f( U1 x& ]   ! P: }7 `* g. ?
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
% o2 [( W. r5 B8 J  
0 P7 r" ^& w3 P0 S" s( r  -l size Send buffer size.
0 X/ g) H2 h- Z* f3 J( D   2 Y9 k3 {( k$ S/ V. h+ d
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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