|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 1 ^# A S! R$ K# _
' [" t; L7 {( z3 O5 t: o9 {
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
' d9 y4 q7 V. w( S0 b- z2 |3 ^5 v' b p4 j4 Z) |4 h* s8 Y. ^
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
" u6 t1 p6 u; }0 G T- H0 J
/ _) y$ s( `( k Options: ( X B$ o7 V2 Q/ C7 R
" X: z& H+ n6 N5 z0 z5 x
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 3 C6 L" X. ^6 H4 j4 S5 q
! I. }/ A. P6 `0 a4 L- s2 A
不停的ping地方主机,直到你按下Control-C。 2 l) _' g* F1 [4 N" O
" k" K1 d) c1 v, e4 |4 I 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
1 q5 c6 J, Q- m& V5 L 2 d0 D3 ]( S2 O: Z b/ n
-a Resolve addresses to hostnames.
: O$ u% C+ W7 E3 ?! C6 k: S
- C9 r: ]9 B" [( }& j 解析计算机NetBios名。 - V7 o" [$ M: B4 y& C2 x
; Y! G( {& v# z 示例:C:\>ping -a 192.168.1.21 4 Y$ @, {/ r( B! `3 a
7 _( g- c% `6 S$ y" v, q Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
* G! d& y' z# c+ p% z ( M( J3 `: F. V L
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 I+ g5 ~0 }0 q4 m4 H& E0 D
. ~+ ~% }6 @+ P
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: J5 d }2 ~; i' f2 v* M' \5 R
; P0 E# N+ i' _7 Z. S Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; c5 b! `6 I5 @* @
) O( Y! z: q' J7 U; w+ r0 h& [7 J8 y : G4 l; E$ v ^% B
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' Y$ J1 f2 i, _9 t5 s
1 u+ f( b! ?- d6 x$ b1 y+ q Ping statistics for 192.168.1.21:
1 U, O0 m% r6 d. @- x/ N, b
" s2 L# v E7 n Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
3 |) j; ^, D3 P* u " \( ~7 u& i8 P( l, i- ~
Minimum = 0ms, Maximum = 0ms, Average = 0ms * Z* p6 W7 @$ Q1 }2 b4 p$ J- g z
" L4 F& S l" r" @5 M2 H 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
5 J/ t% Q; Z( ?+ n
" O. {4 Y4 A7 b1 m% ] -n count Number of echo requests to send. / f7 C- N! ?8 _1 V+ U2 Z6 E
# [2 s9 l4 `% F! o 发送count指定的Echo数据包数。 q7 Y8 K5 ^) A n
7 B3 q& I8 \' g0 ], N7 I3 { 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
d& E+ C, u% d7 {8 r 2 I) A( B0 z* a+ H* G" U4 I+ ? p
C:\>ping -n 50 202.103.96.68
' U) g5 I; Q8 c( l9 i/ r1 W) L$ D
, d Z! _8 l0 |" B5 {; d1 l6 c( U S Pinging 202.103.96.68 with 32 bytes of data: . _# {2 D. P k
$ o6 c" h6 r/ o: k# n- P Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! _- k! A7 i: K9 }/ P: k/ K
- e8 ]2 p2 e0 M/ n Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 f2 ~4 x' u( a/ t* p5 e
" Y9 z' `$ w, C: M: L! `$ F
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- R# p. H; C0 l4 d5 z
: }3 r" e. ^5 V! P( g Request timed out. 6 L9 y- R9 F& a" i& f7 ~
+ V6 { C. i# h
……………… % \5 A Y! S. u3 E/ g
5 e; T( f! G+ D9 _, _' E9 o
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % v G6 F/ h2 t; o
0 o/ d: n! A% _% C, o Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- q W- C0 z! n2 b; @. C
& E$ q8 i0 g! }! @9 n Ping statistics for 202.103.96.68: : e" c+ B1 i$ Z6 ]) U( g4 l" I
9 `6 O$ m* n) s* m% c5 O( I0 e* g Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ' k: T/ |* p7 z1 D: |- T! S a7 I: y- O7 E
# K1 o! P0 \. Y- s! Z
Minimum = 40ms, Maximum = 51ms, Average = 46ms ( w t0 ^5 B/ D1 U( _
) H+ h' a3 u0 V+ B4 o! r0 q
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
, s: W8 w c; [ : a4 c5 m, B3 Y
-l size Send buffer size.
1 c' ^1 F9 N$ r; E : O: P# V( s5 w
定义echo数据包大小。 |
|