返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
5 R0 g1 S$ P2 g. a) R   ) {( [1 h5 l, X* U3 Z8 B
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
! ]+ w. f4 q$ D8 Q. l  
: E2 ]; p8 x6 W& d1 _3 _# x  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 I4 U6 ^; e  @- F! B  U   . n2 P' \. B( V
  Options: 9 t: D/ U- F$ F& v/ R
   ; `) H) C! g- U: y  J
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
4 X* I: |9 J' b$ G     e6 S% _* W5 R+ D
  不停的ping地方主机,直到你按下Control-C。 " C) m4 e2 b' }% g+ y3 H7 q
  
, y& x5 _+ h6 i* t4 }- P  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
+ i; u0 ?# w2 d; N! S" d   8 x5 Q4 M" G: ^2 a, n6 s
  -a Resolve addresses to hostnames.
6 i  ^% i! E1 L& x/ }0 |; D   8 {% a; y& J+ x; V
  解析计算机NetBios名。
! t3 `/ u9 |5 w; I   5 ?' s7 k) Y: i9 j* F' D+ ~
  示例:C:\>ping -a 192.168.1.21
$ a+ c( y6 {$ A- n& E1 M! }$ r  
9 w0 c) o( T2 {$ A& f4 j  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 k: e7 G% _/ O. C5 C+ A) h  
8 m6 g; M5 C% V  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - y! j* u3 l; e$ j& n5 M6 V
   ) T9 p. |2 b, Y1 j1 d0 X
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 ]' \* G/ Y0 P, _& F5 m( @# V/ K8 U   3 P# y3 n4 X" G( [0 j  \: Y# l
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 j' g& H. @$ I  }) Q5 K( y! ~( `( g' _* @- v$ D3 Q3 H
   ) R# Y1 F% ~3 ?6 d9 p' {
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . S! |# U* p5 l3 Q9 Q7 z) }* u
   . [. z( p! ?* o1 A# x, v6 E( }! |
  Ping statistics for 192.168.1.21: 4 J6 A$ a2 @1 m& v5 u+ Q' E
  
  q) L0 H$ v5 p/ X7 C" W  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 Z+ t' w$ e5 c' g1 F8 H- z8 T  
, N% M' G% W+ Z' A  Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 _' d" q2 g2 U  
; z- u6 q" D) i, y  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" l2 B6 }' n4 f2 d  
9 }5 b) m0 \) Y9 [2 i1 f# T2 \  -n count Number of echo requests to send.
- S! b, k) N7 J: D3 x8 V   : r' ~" C& Z/ m; ?, K& a
  发送count指定的Echo数据包数。 $ w* {' B0 \) V6 E8 {# _
   4 O/ P, t7 e6 W. F0 C
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
6 n  r9 W. e7 k: U. P) c+ D6 y  
* v1 _0 k4 n) o! A+ Y  C:\>ping -n 50 202.103.96.68
$ \6 q5 j) E5 u5 j8 k   & L# D! [/ f1 d$ T) s# T8 ~, T
  Pinging 202.103.96.68 with 32 bytes of data:
- ?& `% s8 x( }0 y  
8 D! J: x/ @. D  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 E) M7 ?) l$ q: G' B& I7 y
   0 M! z5 _# ]  d7 a1 y2 t
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 Y# g; w0 j/ s- b! l  
9 U1 q2 i; S8 L! V  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # ~1 ?" N7 q" w3 z# j$ \
  
; I# v  H1 s$ p4 C  Request timed out.
4 E" V/ p3 V" |: S; i   5 `- Z0 ]3 b+ S  X
  ………………
9 s+ r. A; O( X/ {+ M% |& |  
$ B3 Z3 L: O- H6 s' m8 ]  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) I! N) t8 f1 C1 O( M
  
) q" k. D% K) B4 w  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; v& K9 T: X# r8 ?3 l7 T
   . I+ h' L% [' l! U
  Ping statistics for 202.103.96.68:
% V" C9 C+ U5 |# J  
9 o! Y* O5 R+ r  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: # \' E1 V2 y. P  f1 ?+ _
   , D+ M3 Z; [, ]
  Minimum = 40ms, Maximum = 51ms, Average = 46ms / H" z$ D+ o* Y  ^) H, e6 ^
   . j/ R+ ^5 `1 G' z8 E: T# ~
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 + u& `  {# V' x8 B) {1 C" a  q+ I9 Y# A
  
. g+ ]0 |6 U" I0 B2 a& i2 X# N  -l size Send buffer size.
. H! P5 N, m( p9 x6 E5 u3 z  
2 K8 N2 W2 z  `3 a1 M+ o8 v3 S  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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