返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
8 X3 G8 h2 v, Q# U   + F, C# |! _- }7 X6 Q) R6 G+ {8 h
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: " E6 Y( }' `# l
   7 e( v* ^+ [! 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
7 D2 e3 b( T9 ^; [. Q+ w7 x& Z  
) O/ o8 n; }: X4 _  Options: + B" S& e+ t5 e# d3 j5 Q( r
  
. P( p+ L  D7 f/ G# Y& K  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. . l* u. W/ P0 X7 J& p& P! f6 Z: Y
  
6 U9 s* \3 T9 A1 V! Y6 e  不停的ping地方主机,直到你按下Control-C。 8 t# l+ w# h$ x/ c; {+ Z
  
. v2 O% Y  y3 y. Y/ t2 W$ A  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 , H5 T. O; \6 ~0 Y
   / N2 K5 `, w* D( j/ T
  -a Resolve addresses to hostnames. 7 Q! L' N- E/ }
   : v1 G: E" P+ F7 k: {
  解析计算机NetBios名。 ( t* U- p2 j7 d/ E" e; `, Q* V$ Y
   " m2 y2 X: Y0 W; [$ ~
  示例:C:\>ping -a 192.168.1.21
5 u* ^( k1 \' D3 |7 ?   . R6 Q- h8 [% K5 ]: d* E1 ^
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( m7 i8 H4 d" n
  
6 V+ {1 ?$ P0 g4 e5 o  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) N' w: g: ], I% l# r   0 ]% X. T. v0 W$ O% L
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 r: c+ P8 H* N5 x; @+ E  f  
0 A; p! U; j# O6 R# R- Y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: C! G, _& g/ ^+ S  B1 B! l' y) f" \; s3 A( N" `. b
  
! F$ j- L) ]: |( \% C8 \9 ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! x7 C: K) y$ q8 |4 A' g! {
  
0 f2 }5 q. S/ ~8 \% f$ f- I  Ping statistics for 192.168.1.21:
5 o+ E, j9 K$ }   2 k" R% |+ j/ g$ m6 K: h
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 E6 s  h& S' q; w
   ' e- M0 I6 v+ y: J0 |! K
  Minimum = 0ms, Maximum = 0ms, Average = 0ms / c3 _1 V( s, ]; h# z8 e! U; A) d
  
7 b# \4 d2 x: D  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
, y3 `  {2 {; Q! o: A! [  
# z/ n$ p; B3 f, |  -n count Number of echo requests to send.
* I, L$ j9 N" _3 T/ u0 [  
9 Z' [, \9 N* T$ E9 M# O% q, j$ r) Y  发送count指定的Echo数据包数。
3 @" m$ L; C  D  ^. @  
/ i5 \9 j) N, g  p8 Q  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
, e$ `/ }, x8 I) n- [# f  
; b: `0 k& P/ {0 [6 g4 k  C:\>ping -n 50 202.103.96.68 4 }5 T( P# B8 b  ^! D+ J
   $ A1 \. D# O5 V& @
  Pinging 202.103.96.68 with 32 bytes of data:
# q+ w) W. i2 b/ Z  
- S; G3 U$ L& c# V" z3 _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 Z6 O/ l0 Q' A4 {! ?4 L* z   # z7 Y! o) L. x5 ~
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 R, h( ?2 E- M/ G) ?) Z
   6 a# r/ X4 S  q. Y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + l: B6 R+ E% U; q. Y
     @5 X( R4 E; Z& k8 R4 d$ l
  Request timed out.
$ }5 d- M. p- Z* A9 {/ }  
9 k) p0 R' b7 C. T" E) U7 `( ]  W  ………………
- ?5 m. T3 U: E2 p# a6 z  
. u# j% t* T2 V/ Z- }  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) C' l: n7 f  h% F% m
   # T- W; I: W. l! e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, Z' }$ @2 y. F9 i     g4 A; O$ A0 o, \: n9 \! Z
  Ping statistics for 202.103.96.68:
0 A3 @- c# w. h5 `7 c% c   2 E* J- F+ r' c; E* S+ h; U
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: / O+ K3 m" R* Z- r# ~: o  W
  
& U+ c! F7 V0 p' n  Minimum = 40ms, Maximum = 51ms, Average = 46ms
$ A/ P6 L- \7 q   ! V/ b  P! c) x0 w1 Y: V# v/ M
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
3 i4 b* d1 y$ h1 y$ v/ V   $ ]- e4 F* M! r8 y" Z2 L2 s+ Q; _
  -l size Send buffer size. 4 Y+ k0 L7 T+ s0 a: E7 y2 K0 C) X
   ' L* ?# L( ^" `5 U" Q
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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