返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 5 z' a. S+ j+ O' Y% u
   8 [: M6 w6 R9 j
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: / _3 ?7 z8 ~: v1 E- Y
   & W. w* d- |+ r6 D; e0 \$ t
  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
+ T. e* b8 e% L0 N) R$ D% O2 [' Z  
$ _+ q- t1 R7 B( Q# s0 J) t  Options:
% c5 L: Y) \% S2 Y/ B& n/ P' k   ; O) i6 `/ E8 I! Q, o7 ]
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. $ w& J+ Z+ c9 u2 x2 i" J' w7 v7 w
   ; c5 V: T! E' [: `
  不停的ping地方主机,直到你按下Control-C。
4 e3 W% P8 @' u- o1 @$ \# Q* _: c   - s2 D: t5 m: z
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。   [3 m, m- B' D& j) J# D9 t% D
   * a3 z  U4 N; `
  -a Resolve addresses to hostnames. 8 ]& q, u$ d: I* J
  
# g* u. S" L7 u( X3 N  解析计算机NetBios名。 - j, B" T. V6 G! g. z7 s  {# p
  
' A2 F( q  r# j" A" C$ Q$ |  示例:C:\>ping -a 192.168.1.21
% g9 \* }- i+ ~; f) Y7 H( A  
0 R5 q- g: h# v; H2 }  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , i. T* C% [  S# X$ _
   7 @, P5 f# X& n
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 b( A! M: F9 l( D3 T   5 |1 l& Z) A5 o' Q9 d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 N* t7 S' f$ W, V% C* x( u, A   ! [, j: [& q/ W( [- x; S- E
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. P3 k" ^/ e) d
1 B5 E0 }  x' U2 H: `' u  
6 T1 j) c; @$ I- W, l  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( Z) U5 h& K( [1 ^/ w  a   , F/ Q* N- D) L, H3 L
  Ping statistics for 192.168.1.21:
+ n  H- x. H( y  
- w' p+ D( w9 U1 G, {8 F  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 9 x. y. e0 X, ?- h3 V/ f- o5 o) g
  
: F& u# G" [) S  Minimum = 0ms, Maximum = 0ms, Average = 0ms
$ m7 i7 W8 B8 n$ R- {+ Q  
, U% d/ v0 D, w$ V$ t  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
# `2 z/ Y7 m% ~  
5 ~7 R+ g* {, w# y- I  -n count Number of echo requests to send. ( o: X7 I& s. H+ A& y5 ~) S
   6 I4 B5 M2 x. T
  发送count指定的Echo数据包数。
8 s" V) L8 H5 t; w5 V0 s2 s- \   : A/ k. K* h, ~7 H- I4 Q; d
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
3 w: T  b  W. U  
7 S1 ]3 O0 P( N6 k, d  C:\>ping -n 50 202.103.96.68   f5 ]9 ^6 G& i1 _+ z3 S
  
5 Q& \/ R6 S( A4 M8 V7 z  Pinging 202.103.96.68 with 32 bytes of data:
1 b' s9 v8 N; A! M( l! O   5 Z7 A! X% S1 z+ s8 x. _8 W; `# k. [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( T+ y4 {- v6 Y  
0 v9 t. I& r$ j  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! ~# ^* T. |' E: L
  
! R! z8 b" t; r/ ^  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 b/ [# d/ \# U7 ]/ o) B   ; R+ M' E( Z. z1 D- l$ P
  Request timed out. 9 i* R0 e) S/ `2 t! _+ u3 k
   5 g. |* C( m2 b# I  v6 N: V$ V
  ……………… # o3 Q+ z8 N! {, @" x% F9 i; v
   ) a& B8 B4 V0 ]! N) a
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   J5 x. b& {; }- ]9 X
  
& j& ~0 O( B" X5 c. Q  p( Z4 J2 @  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  x2 E& M, k1 L* v5 k  
9 a# m% e; i# _# ^( J: r  Ping statistics for 202.103.96.68: . H) L9 w1 k8 T# O( j
  
0 O; J. |( p7 n" j8 O* V! _  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 9 B! T, r1 [$ U5 z  s* y: F
  
2 Y8 p% D  l( O% ]3 T7 S4 _  Minimum = 40ms, Maximum = 51ms, Average = 46ms 5 i* v, B* b# W/ u: t0 E
   5 l& s& a. V: q% k9 C' [, T% H5 Q, p5 B
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
4 c2 a/ Y; Y" z) V7 b0 Z# t9 z   ; W! M- |) c7 p
  -l size Send buffer size. - Q$ f. C" z0 S
   5 K, `: Z9 b& N4 f
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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