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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
7 a" |) s2 o4 r9 G; a  
6 R# a" L% o+ j% G1 r  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: & B5 i& E/ r: v0 D2 ]/ r; J6 |! U5 D
   0 X( O; ~0 c9 @; Z! ~; q
  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
' R( r+ K9 y0 p. B1 Y+ w( I  
9 o- Z, Q# j1 {& y. [7 h/ s5 r4 |  Options:
& G' \* X- ?1 H   8 b; |4 w# T$ W: i7 j2 g+ m2 q
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
0 l( l1 S! B# m   * k. }' H& _6 L" f
  不停的ping地方主机,直到你按下Control-C。 * p9 v' Q+ p( h" |" w5 a
   7 s/ n1 e: ~) Q
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
- |/ {5 [  n- {  
; E0 r, o' R& ?  B  -a Resolve addresses to hostnames.
: {/ |7 m, O* L9 T7 H& R   * ]% u6 k! i9 W* i2 Y7 ^
  解析计算机NetBios名。
  G0 t$ r: i6 v* H$ d* n  
; H' t$ c: a: P; Y" d) @  示例:C:\>ping -a 192.168.1.21 6 H+ \' p& \4 s
   0 J6 F: a. p2 ^3 C
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
( ^+ u' q1 I; b: S. w& c( L   ; x; n* I: g3 h& O7 o
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . `* J4 o" z7 X( E8 N+ |( `! s2 N
   - P$ r: Q* c$ l
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 R$ B1 g! `! C, `- u+ U   4 o) [( ]9 S( M! a! ~) J6 B) o
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 u+ X  \8 N. ?* ]- ~! e' R
" ^; f2 e* d8 ?  U6 R   : C6 o0 i4 v  w2 z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 _. g: v% L5 ]' g  
( S7 \9 M5 a- k. X  H, \( f  Ping statistics for 192.168.1.21: # Y* m0 j! |, B
  
+ Q* n1 I7 r) A$ }2 ]& d; u. B0 C  }  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
- t1 N" I. f% t- g+ j7 u" {) C  
% L' \3 i+ C- [$ S$ r; |$ `  Minimum = 0ms, Maximum = 0ms, Average = 0ms
+ Y& `8 b+ w3 m* n7 p  
( d9 H- Q- _# V8 g7 D0 W# p  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 $ p& N& i1 A5 r8 J  I7 W# Q
   ( }1 J2 [+ U- Q  N2 W& F/ b$ Q
  -n count Number of echo requests to send.
5 w3 p5 F* \3 S1 O- x  
9 u0 i' O( k+ v0 a" Q, A: d  发送count指定的Echo数据包数。 . B( I) S" t% y' l, h! d4 }- h
   / O# t) x. s+ p, \5 O( X
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
9 }) O7 {4 f0 P& H  
& F+ {) O2 ^& E  C:\>ping -n 50 202.103.96.68 ! W( s& X- N& t6 Y! P, E
  
& K) S) u3 i8 n3 C/ m  Pinging 202.103.96.68 with 32 bytes of data:
# h# r1 w. `; T7 F+ G  
) _; e* X( ~8 H" G  o2 J  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 \. y1 p; s3 }: E- d  
7 i: H* g7 b' T0 Z' O  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; [$ w, F. g% I$ Z
  
0 M# @+ L+ Z8 n- B  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 Z; n% W) m5 i( N
  
# e  ?: O4 ~% M4 a$ b# Y  Request timed out.
" c7 v) m3 X0 c   ' p# `2 J2 }% t
  ……………… 0 ]1 `2 c! m+ y4 y
   # T4 F" I! E) s+ S; ]+ M. D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' i  Z9 @3 _" w. t% }' B   0 @0 s* e6 ^9 b  R3 D0 h# V; P6 L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* `. ]( r# i# D  
- ?- d7 U  J$ ~4 v  Ping statistics for 202.103.96.68:
8 X) T7 H: h! u2 O9 s. l  
- w4 Y1 E$ \7 d! b2 _9 Q& p3 m  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
0 O3 A2 s5 b8 p  
* h% G% y8 V# ~- [8 |0 W  Minimum = 40ms, Maximum = 51ms, Average = 46ms
! n: _" o2 J7 o2 Y. X% K" W: u- \  
/ v3 ?: x' l0 m& u% _; \# L/ a5 S  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
" E- V, A4 i* Z) C: C" X     O2 I1 V: i* N9 L7 |
  -l size Send buffer size. 7 S, e5 G& g! H' ?: n
  
6 v4 @. e4 y2 w" ?$ S$ p( j3 s  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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