返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
+ d6 }, Y. x- v/ o" J! K. h  
9 m  R1 s/ D" Z7 |3 C: B- b  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 1 t/ l5 |0 L/ M+ G  h) p
   ( X" G7 s5 g0 [/ V! N
  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
" x/ o0 v% I5 l5 m  
& k  o8 G( y. E5 `$ m, G  Options:
5 q0 k" j/ E: q* Z- c+ q+ X  
2 H& l2 u5 P) T3 M7 I2 Z  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. . W$ `5 ?* c5 A" C
  
1 y& m3 m* z: G8 s  不停的ping地方主机,直到你按下Control-C。
$ A! |0 u' |) E% V- I/ Y8 R  
( {/ ~5 ]5 D! ]  F6 m  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
, ^) _: P: x0 f# ?  
( e" E- [3 {3 ~% K( ?  -a Resolve addresses to hostnames.
7 ]$ p9 `9 t2 ^; E6 D  
, V% h& G+ K& Z. N3 A% O' e  解析计算机NetBios名。
/ g3 P- W( S0 N& D4 A, r  
% o7 B  t9 I$ F/ x  示例:C:\>ping -a 192.168.1.21
  u, W& ~* i; X7 R* m. f! E5 @( U  
9 }9 k! p8 _4 m6 V- \  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 0 Y! |* r6 U- R3 r0 E
   / u+ k, \" E/ s1 q5 U. \/ A8 ~
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% ~" o* n1 B, |) n2 ]8 E) M7 `( w  
& a. y, _$ o2 K  J( J' x  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! }& ?/ `# K3 _  
0 k6 b' R7 v$ h: R) i7 u  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   K" Z& F0 B: \5 }/ K# |

+ X4 P; {- z5 e/ l: j   - V- i  M* J$ N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) A2 k2 c% v+ l; V
   % i: [/ Z' B; g& M
  Ping statistics for 192.168.1.21:
- n9 \: G6 |+ z+ e- X! l( W8 \& s* f  Q   6 x! m( L6 z* \
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 z1 C) i( K: a8 d  
% Q- b4 |9 e* J; i; ^9 i. J  Minimum = 0ms, Maximum = 0ms, Average = 0ms
9 p9 @4 t( e+ W, @0 e: E4 W  
3 ?! O7 z- ^  z  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
( c- h; }2 h  Y' u   ; Y; Y( [3 O5 x2 |9 }8 ~
  -n count Number of echo requests to send.   M/ V% p( g  s. K
   - j3 y  L( _. V6 q; d& e
  发送count指定的Echo数据包数。
, e0 F. A. g( ?' q  
* Z. L& q7 Y; O- _# h  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: " g# P' T1 B/ L& Q" c' O
  
. }3 M& [  M) `+ c7 e' y: S1 ]3 L  C:\>ping -n 50 202.103.96.68
2 o4 s& b  W0 O8 b8 d3 }   % }/ {5 u, Z# i$ G
  Pinging 202.103.96.68 with 32 bytes of data: 2 N# K, L; ]2 j6 S- L) R' }
   & R+ f6 O* Z/ o6 C8 ~( Y( o8 L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 v7 T/ t( m; G
   6 r  c' x% e+ s& Z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' T  H+ Z5 Z* I# o  h   . s, ]! U) S$ i9 H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % N& |# f4 ]# j8 a4 R3 D, D3 t
  
/ c# T+ }& f( i  ^% w1 T8 l  Request timed out.
# {( L$ v. a/ O" Y   / B* w! {' i- A/ K" t
  ……………… + H! G5 g# U% J" B% F1 w+ z9 A) P! R3 `& X
  
; V# m8 C# y9 U  Q# g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 {0 z, Q( y( g" P   / ^- h( u: N7 x4 }: _! S0 k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * x. O) |3 ^/ g2 z7 R3 J
   - L  m  W8 {# j3 B8 l
  Ping statistics for 202.103.96.68:
3 @, w+ ^2 Z- [# g" Q- }1 {   & T) E' ?; w/ {6 A8 ~0 x' U8 E
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
3 P. p% h" P: ~: E/ a   & t( b! s: `' X' ^# p
  Minimum = 40ms, Maximum = 51ms, Average = 46ms / r; O/ a- Q4 f, O
  
/ v4 A1 C: M, U6 s  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ( g4 O6 x* O  }( l
   ( A/ ^5 B  l% N! C& I
  -l size Send buffer size.
- n) A& J0 r2 F6 z+ \  
' q2 b6 X  e7 s. Y' ?1 l  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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