|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
) I, n! H) ~. o) g) v! L F0 R3 Q * L2 }" x. k" o; j
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
1 S; w. {/ |! E _, V6 O0 V) P
- G; V5 @2 k- g# x9 ^, H7 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
7 f& i. c0 D. |7 ^+ ?: ? ; V& R0 P8 Z- l9 x3 n: ~
Options:
9 ~ }# w* q0 x0 l( f+ x I1 [
8 S& A1 P9 O& @9 u/ | -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 2 U) H3 A! x o+ j0 L, l
; {" D& x4 s# N
不停的ping地方主机,直到你按下Control-C。
# S- r/ s5 @% K% A* t: Y
: i; G9 h3 ]# x* r3 m3 [; o 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
) m5 D" y/ T/ ?
' a+ a( c& h7 L- I2 ^( o U }. |* E -a Resolve addresses to hostnames.
, |$ z8 b7 T5 H' h- k8 R1 P
8 J0 F( I# n) ]: Y- e9 f' u 解析计算机NetBios名。 4 W; l+ l8 Y9 ]* V" o6 W: \2 s
: C: ]# c ~8 H A/ H) Z
示例:C:\>ping -a 192.168.1.21
4 K: q i Z+ F0 k8 {" l4 U
1 X3 w9 X" Z9 L' X% \& n Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: % Z5 {3 L. R- k. J3 O
& b# G* z3 l' L; v+ m Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ y& e B/ S2 [9 G9 w, ^
: U4 ]% e4 X6 g) {* o: s! V) y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, r: I- I0 N7 |2 U & {$ H$ c5 J& t1 _; r# y L
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) [" O! X9 n0 o! J! w- d
, H4 \- n' I0 v9 L" y* C! O
* @* {0 U/ F# e; `$ b4 v1 }9 ~ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' S8 n. H/ [! z1 b: T: U5 ?5 @5 U5 C: }
' V7 c* }0 G2 I: n( K9 f Ping statistics for 192.168.1.21:
* P/ S4 T1 J" f; \* z% I' L ( f1 S+ @) T j2 L, P
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 q9 Q6 i( w/ E- k 3 ]! t+ ^4 }# q7 B
Minimum = 0ms, Maximum = 0ms, Average = 0ms
, [3 n9 h! `6 v3 @
0 F o3 G5 h2 J1 [ ?. |& ] 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 / R8 s2 `& \4 |. E2 \6 p3 \
/ P/ s( y: [# h, m$ u -n count Number of echo requests to send. : N2 S0 f8 j1 C8 l' S8 q$ i' P
" r3 n/ M' ]) g 发送count指定的Echo数据包数。
2 I( _2 C5 b$ U8 T
: J. ^- r0 d5 k, Y g6 f 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
' I: @1 V/ d$ {8 Z- K' i+ U& o 3 y4 a+ _# l) M; D
C:\>ping -n 50 202.103.96.68 8 n5 ?- b1 p0 \) H
+ O7 j$ I1 r1 i: o0 H Pinging 202.103.96.68 with 32 bytes of data: ' x8 K2 L/ g( L
2 `1 ]# w) s5 R0 l7 @5 h
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; c' h1 S$ S& p5 V
0 P4 u% z8 {; @/ R
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 q8 x; K9 a/ V5 y 0 v: b; w% ~3 |) r2 g1 f
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ B. n4 J% B4 i
( V; w2 V: Q4 ^1 V5 f0 d Request timed out. 5 D8 p% Q, q y4 ` O' R* E
( y: E- l* x( `7 H& I8 L+ f ………………
+ T( r0 M/ H% ?* } ; F B) l9 I) x
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* Z1 n+ Z8 \0 R9 P0 d( w% t
0 x% u! r2 B& X8 w$ {0 w& [ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- I0 v3 d" F/ x5 V( U1 H% e
2 d! @$ }$ l) L& v Ping statistics for 202.103.96.68:
% t1 d3 R/ Z L1 e & q$ H2 u2 j2 R8 a! J# q
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
( X7 R, J! }9 s" e+ ^& ~, w7 w. w ; d3 d5 F1 A( T& q4 N# c1 @# Q
Minimum = 40ms, Maximum = 51ms, Average = 46ms
3 `0 q3 Y3 `; V! e [3 Z$ Y" }
- m/ g9 O3 G6 u 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
$ F. P8 Q- f# V* U; @( g
3 {7 v4 o. _$ J8 _( f1 D) u p -l size Send buffer size. # M: p8 D/ h' O# C8 @
* [' [: D. Z$ }, k 定义echo数据包大小。 |
|