返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 8 O0 p* [& c: F
   & H/ ], G- y6 u5 _4 W
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ; s  b: h) a0 `8 S( p* R3 H
   8 w# \5 }. }! _2 A. V# M5 H
  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
* d- L" I0 m( w8 H6 V  
/ b' Y1 H& Z, U- r  Options: ) d2 Z( T2 d& l9 D: g) u: ]
   " w/ }' }5 k: a) U
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. , {! m7 Z: p& @
   + [% `" V6 U- u6 E) \7 J
  不停的ping地方主机,直到你按下Control-C。 9 C& Y8 l9 H& y0 I- R( F
   % L6 j+ ~! R! D$ {$ v% m* _
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
6 z3 {) a' R7 d+ _. ~* p8 |  
/ |' Z8 s  B& V" w+ S  -a Resolve addresses to hostnames.
+ ^3 d& m) Y7 u3 R' X- x   / d' m: A( [( z: w; ?: _
  解析计算机NetBios名。
. K* f: h) w5 ^/ M  
1 W. [" _9 H4 v9 Q# E8 o  示例:C:\>ping -a 192.168.1.21 / w: V( a4 G: Z' q, e; q7 d
  
4 n6 m# S4 d' U' d  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( J( q) v! O( w5 y1 @
   ) @- X* {5 m% R5 N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" d) l& q1 g- P6 b8 q0 d& `  
; j" }, X* [1 P) ]; R1 i  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 B5 D& B. ?0 r; j2 |9 u5 ?" m  
6 L0 q, a) [4 E4 x! N" Q' |9 l  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( C9 ~- V* _! j) a
+ J$ ^/ J  |5 C$ V# Q# a     d  A5 p8 b* |) l9 l
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( s3 h2 @; p0 a& q- o3 k0 D$ ~
   5 E/ i. K( m. E6 C/ t7 w
  Ping statistics for 192.168.1.21:
* ^( j2 e6 o/ p  
- ]1 A7 m; Q& u# o' J  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
2 S# v+ m* J& Q. ~: P- n  
2 Y! h$ M3 t2 I5 M% t) b  Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 k: C# O' Y+ j4 i* L4 e7 p  
6 o) e8 x* f. k3 E! `2 X  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
: g' T8 w4 j3 ^' j  
1 B: O* b0 |- s4 O+ |7 S+ ^& h$ \  -n count Number of echo requests to send. " F! S7 ?$ p- m2 K/ Z- I
     y. R4 [+ M# q/ m6 y& X5 A* c+ L
  发送count指定的Echo数据包数。 - c& U! Z7 y* [2 {9 j- M* e
   ; X. d5 e- U! B2 u1 z9 D! w+ `, L
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: $ ?5 o% F2 I: z- R: n. P8 v
     R% D3 t( k1 z" I# e8 u
  C:\>ping -n 50 202.103.96.68 - B: }9 K% V, P3 ~' K
   2 m+ W6 G- I; @, L
  Pinging 202.103.96.68 with 32 bytes of data:
/ Q" h  u7 t' G7 P. ?4 I, J  
/ C# x( P% |( s  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , S# T. Y8 N2 B, I6 C
   % _/ C+ P+ W- _( @+ M% g
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ g+ H" A! U7 S' C* i; K7 ]7 c   - W! x1 O/ Z# B6 a5 w. ~6 g
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 \2 @$ [( {% ?& m! t% c
  
" |* b9 w* M9 _  Request timed out.
; ?- a7 j* D+ B- T: w6 S- S  
- J7 X* z4 k6 l; D, R& d4 n  ……………… - v0 t* }/ y& r5 q2 J- _- h6 z
   7 a. _, U/ m5 j" p' Q. @( p
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, w8 p6 e8 y3 x5 g; m4 F$ |   , z0 i0 Q( n" [4 f5 x4 A
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , ]1 `6 ?- K9 {* f
  
: b' y, U8 ?) N+ K2 F- ], ?0 M/ _  Ping statistics for 202.103.96.68:
0 A" N& r9 g! i& M, J   + G# l, V; {& x. b: ?: f
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
$ l# J4 S: L" u) _& q  
0 e  E9 d- \( j- @5 f  Minimum = 40ms, Maximum = 51ms, Average = 46ms
2 x4 [4 e0 D+ T& p" s   + f! L  \/ \, f5 F. s; u: B9 Q
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
& t- Q# Y% z* d/ s( f  
2 N6 u) f: Q2 v% I8 _* b8 B4 O  -l size Send buffer size. , C4 u1 ?( ~1 |* H. {
  
) A6 V6 P0 {9 G# B, {+ G6 Z  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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