返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 7 v  q2 e! t5 P+ A- C
  
6 M2 O- U: j8 c+ u; M' f8 v  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
- ]5 |5 j  i" \4 `" Z; z: o3 _   ! f' |8 j7 V! y
  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 5 d1 u* @7 L% e! e  d% F9 B
     B+ Y. c* G6 a; l
  Options: 4 ]# d& ]0 t  E+ L' O* P
   3 K, S- D4 \4 b  v
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
: q! h; I, O3 d$ Z  a" f   ; v" n3 B+ G; d& w) p4 W" D7 C
  不停的ping地方主机,直到你按下Control-C。
% A, R+ Z* v  q: W  f# V# T   - a. S/ K7 S0 D; c0 |3 |
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 # j+ c1 ?7 F' b, K: b
   8 I. U6 }7 I9 L2 I- V
  -a Resolve addresses to hostnames.
5 q# \+ B( a1 J; v1 Z- T   1 {* F: q/ U/ _7 Y
  解析计算机NetBios名。
5 `) c+ U  W7 n8 Y( G6 K: y# I0 u6 c   2 q, D' J% H- K+ D3 x2 v6 s
  示例:C:\>ping -a 192.168.1.21 $ }; @8 V- G9 Y, n+ Q7 {- m9 p, P
  
3 z1 V& [  {0 f5 E% ^9 q  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 ?- g+ B) F( U1 e0 j  
1 ?) a0 v+ D& p  C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - x: l7 J: c2 Z, W$ z: W7 M
   3 ?( K( k  Z* F  ?
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # Z! d9 U% m- w$ j% U/ r, {" T
   ( `# g- R; _% h0 B4 Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* H$ Q+ n% F* ]' d6 ?$ E( P6 s
0 N: y, f2 ^. F* N0 ?: H   5 O4 K2 u  B4 Z# _
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : d6 E  j/ r! \* e# E
   % F% v+ g1 `8 C* _& m4 r% F6 o
  Ping statistics for 192.168.1.21: 3 C1 W) N( V! {% }. e
  
' K" [, [. ]) Q7 n- \  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
& ]! Z& a% ^8 K3 p0 Q1 ~' r$ N   1 i* K) _* Y  P. Q
  Minimum = 0ms, Maximum = 0ms, Average = 0ms : E9 V; Z# R1 Q6 z1 t; [; x
   3 B* u  p7 e0 R1 Q  b% ]
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
+ N- E- [' u, m0 k% p   ' K/ |  d2 z( @6 s
  -n count Number of echo requests to send. % }) p7 q1 g* M; V5 m" F! k+ U
   " j; w' s% E: V2 c" U* {
  发送count指定的Echo数据包数。
" H; ?+ F9 ]( @' a   : \7 E3 R6 |- ^  j+ Y8 z5 u
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: # y( j/ K, C+ B8 ?
   . C/ M5 g, L( q% Z
  C:\>ping -n 50 202.103.96.68   \: Z* `+ C2 b' N" T& i! x
   / U0 o/ S. I( N& _
  Pinging 202.103.96.68 with 32 bytes of data:
+ n* Y$ W% c% w   4 z4 [5 A, P8 g' M" b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  L# C3 x/ N5 G+ a' H' `* L2 c( |3 t  
! D& f! t2 \* c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  ~$ Z3 u- B9 s  
4 h+ d8 e) L- N- w( T* X. N4 o. \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 ^0 S- R5 |4 d3 x# I) A
  
6 k9 r! E% o8 k. w0 N) _! b  Request timed out.
9 ]6 }% m( K# n6 n- _   . l' U/ R* Q: Q/ n: g
  ……………… 9 \7 P8 G- f" \7 y; @' b6 C3 ^
   $ t3 D8 A+ o1 z  k. R* i4 l
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# f/ X( x$ }6 }2 ]4 p! y+ N- b, m  
( ?2 e. G" I: Z1 R: M  \4 V! z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 I) j: X; f9 F  \6 e; W; }
   2 G& L7 L4 b, v
  Ping statistics for 202.103.96.68: # m2 D, B$ A  B/ c0 d* l
   # ~" o% y! a2 m1 i8 f& `, a( d
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ) S" I9 e& B! Z% ~3 f
  
) b6 W: A  y- t  Minimum = 40ms, Maximum = 51ms, Average = 46ms % |2 V3 i+ A( a, R; l* T4 e* R" P( R
   - P3 h; B! d4 h- g2 I/ p, j+ L
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
5 E" \. {' |( U8 e  
! _3 n$ ~3 T: E% ^  -l size Send buffer size.
# ~+ E/ B/ d7 B( J   + p( V1 ^) T& H8 A5 T- T
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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