获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ( t7 @  S7 @  c. C% D
  
4 `8 {8 u% C; E8 N" |+ A  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
6 n# u8 o+ X& j7 f( E2 ]0 ^  E   . Q: V3 _" ^$ K" O* U& Z
  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
% Q2 g: E) {; V+ Q6 Q9 Y9 E  
+ E. C6 h2 O' G3 Z+ L5 M  Options:
0 G5 ^; b9 q, a1 x4 o$ j- w  
& A2 {) s* a( u  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
) i. u; Q; d0 z+ Q+ l$ j2 n& J   & y6 n3 F5 C2 |. z6 B  u, B9 C
  不停的ping地方主机,直到你按下Control-C。
) Q3 S# Q/ C/ a   : I- @) D: G) }
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
' B9 p( J1 k7 z  C7 s) H   0 C- R: U5 d9 Y: X$ \& I& L
  -a Resolve addresses to hostnames. ' r$ d- ]' q7 ?4 h+ |5 H
   % {6 c/ L2 l1 }& x1 S9 \
  解析计算机NetBios名。 2 @/ `6 ~  J, ~7 @
   % `) d8 Q/ T/ ?0 ]3 u7 v
  示例:C:\>ping -a 192.168.1.21
' b8 u# q7 V$ q- _" k% N   3 ?1 a3 j! G" j; E. t! t
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- w/ @! H: i# V/ I3 W  
, I/ @. @5 G3 Q3 }) p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , Z+ m# i0 I/ C4 I
   : A7 `. ^' |3 e' e; T/ `8 `! d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 z4 Y4 Z# t/ v  c, r  C
   $ }2 C% |1 y8 O) q5 j8 P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . Y& v/ h3 i5 B' E, ]' |

/ E' d  p* d; E   6 e1 }/ W( }" w7 H
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & S2 m8 v; |& n& f
   ' v, |3 `4 j: o, c- ?6 ~2 r
  Ping statistics for 192.168.1.21: , G6 |9 a# c$ H. r9 [1 B
   * x( e6 \2 w* W6 Z+ y3 ?! O
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ' Q7 y! ]4 i( f$ I* }
  
9 e2 ?3 f3 ]9 h  Minimum = 0ms, Maximum = 0ms, Average = 0ms 2 C, [* F2 ~& e' b7 e
   , G0 M. n8 _  o+ ^5 m7 _
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 7 K2 X. \, e8 j7 H* S4 F* d- V
   $ F: t6 r8 |8 F1 d7 `( {
  -n count Number of echo requests to send. 9 U) f" y# o2 q3 z9 ]$ s
   , l1 ?4 o4 u8 N% A4 ]
  发送count指定的Echo数据包数。
# D, K: S3 y0 ?+ {! m- f  
4 O3 I! h; u+ K3 u! m; b  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
% [: t4 f: l  ?; h$ D   1 Y( a* P/ }* S/ N! v. C  a# |
  C:\>ping -n 50 202.103.96.68 1 n' Z8 l; |( }) {$ u8 [
  
; ^/ {) a  x+ ~/ [4 Y% o+ \- Y/ o+ a6 i  Pinging 202.103.96.68 with 32 bytes of data:
- i7 s. [. ]) Y& k+ m1 O  
0 A; \8 {6 g! n  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: N8 e. ^1 n7 B- f5 e" _  
& }5 y* r8 I4 a: L) L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # {( |( Q9 u  v6 ?+ [
   8 I8 X1 G( }: J; X, v' Y- d( |1 u( B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 p* I" a; h0 r  G, o7 H( [   & o, B' w0 z- C& R7 d: Q6 U/ M: J# G8 M
  Request timed out.
  L/ R+ f0 V% {0 S% _) ]  
# V) w  |( y! z8 y" b2 q- b: Q  O  ……………… - _1 `/ Y& ?. Q& i# d: Z/ n$ _* Z
  
3 C6 I4 D2 x  F/ J0 F4 m! Q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 ]  E; [1 o3 d% |) C! a
   + y0 C- y7 t6 ]- Z: U, u9 l
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 I- H/ m6 l0 U4 Z
  
/ E- s, b6 ^. C, J" O/ l  Ping statistics for 202.103.96.68:
3 l* M# I* ]% \+ p- Z7 x   / [* Z: n  c8 ~  K' w, w( W5 ?
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: / Z& E# t% ~$ W" K
   ! K" k8 `# s" }! j6 E4 `% ]5 [- u
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
' p# U5 [$ X4 H. `5 i   8 z  H* Z6 s4 m  M2 A
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
; }3 T/ H9 j6 y- ~6 m" F. `  
& E% u( `" |9 H* Q  -l size Send buffer size. # r$ p) n1 Z  y0 z8 S* G" B
   , e" o2 v( l4 @6 U
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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