返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ' Z7 t7 R- o* l. f- A( j' y" v0 ]
   ! O# I. Q4 @+ u0 q* f
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 9 P5 I1 S# j& @& q( K4 X" I
   ) L# j( s9 M' _$ c. j! b
  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
) F1 S# U' G2 C* E$ a' W" S/ A9 n   * k) W) J, P! W1 o6 A# v
  Options:
8 E7 _5 w* o1 V( s5 \- A! f7 s   4 n+ p4 l+ _: I8 f+ r' n+ ~
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. / L( g- l  m3 @4 q- L$ C: i& t
  
0 }& L; N9 D; _; u( L; D0 K  不停的ping地方主机,直到你按下Control-C。
7 Y+ j# C' L, P5 V# }7 t  E   * N& {4 r4 e7 B1 E6 j6 W
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 0 A, I/ s0 G5 y4 A' U; B
     A: X; E! o; e% N8 A" L
  -a Resolve addresses to hostnames. 8 p6 ?; L) a) c  ]8 _
  
$ @7 h8 K- v. k3 e' @4 o$ j7 M  解析计算机NetBios名。
& Q* G! F4 J& r% E  
" X8 i/ u2 A8 m6 S# \, z; x% ]8 E7 @  示例:C:\>ping -a 192.168.1.21
7 K2 r: w! d- Q" |' r3 Q* v, p   8 |2 @: ~- m) v6 _
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ! P/ e, L% T) o0 t9 D( _, }
   0 D8 v* l/ A" o1 U
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 @( e+ x# a7 b2 W7 @
   5 {/ \( a: M, |3 C! @
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 }, B! e# T+ |" M- v7 j* I   % O9 F- U! \& l1 c4 i5 g7 w
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ `" W5 B" O% R8 O2 c6 X- T$ R, [2 r9 o$ p: K) |# y& w( p4 L7 I( F$ d8 m  f
  
; H( w5 p  R% C5 h/ a/ z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 ^1 e" m8 j. t8 W# a
  
- y( ~, }4 s, j, t* g: Q$ K  Ping statistics for 192.168.1.21: 3 X* @! f: P9 a4 F+ A
   9 q: i1 h! x. A! s  T9 Z! M
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: % T( E$ S& x5 o+ U' ~: c; W! ]
  
8 E6 n9 d* u, U& t5 L6 }  Minimum = 0ms, Maximum = 0ms, Average = 0ms * l# w0 T, O. Y, x/ A
   , s+ N' a* \( Z, u# g9 u$ }
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 1 |& l: ~( k# i
  
. k- ~( B  B9 ]6 Y  -n count Number of echo requests to send.
) Q4 C, C* W( ~2 B$ f- A# o  
; I" W& J9 G* Y+ l1 K5 m( [% R. U  发送count指定的Echo数据包数。
; b0 ~+ ~" o% g! y9 p  F  
' F5 v9 K' r! E  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 K- o( T8 x9 U- k* x
   # ~$ u0 E( X& Q" g
  C:\>ping -n 50 202.103.96.68
' o% F& S# F8 A1 x  
; e: z0 x  @, ~+ M; U  Pinging 202.103.96.68 with 32 bytes of data:
/ U& j" J$ O* e' I. k  
8 p, b* `/ b; G- b/ J3 T6 d' b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - u& O) }( }( s$ ?2 ]
   $ F6 ?8 j5 z6 v7 ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   w9 N$ U; `* B) {- |" k
   1 Z/ @6 q- |8 V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) j$ X( h6 Z  Y   - N. Z1 ?$ \3 k% z
  Request timed out.
. ^; o! X: y0 c3 G  
8 Y8 O3 X  Z. {/ T# Q  ……………… 5 g' c1 v  C& J
   7 T* u/ X. F( H; ?$ V( q) ^/ ~4 p
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! I6 K3 f$ X8 J  {$ H8 R3 I4 D9 ?. z  
: `& F9 M9 y) N! C7 Q9 o6 n  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ A' U# @$ H! @# X% y  
  ~) k2 B8 d; y6 C7 b' J  Ping statistics for 202.103.96.68:
. z- `6 k4 u3 Z% @3 z% p3 N0 w  
) l1 E& r  ?- }  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
$ H$ F5 T5 C: X5 _$ v) J: b   " ]0 A/ v0 J, o/ Z  }8 j% ]. z
  Minimum = 40ms, Maximum = 51ms, Average = 46ms * Q) o0 x4 L  E! [) M/ U: j) Z; g
   7 ?4 m; ~  W0 L1 {  S
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
# b, l2 O6 w+ T& v  
) A8 L* S" X$ _% y' M9 W$ F  -l size Send buffer size.
- w- ~2 m( }3 }7 x& c5 k3 }   $ S4 P. I, T3 r# l" |
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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