标题:
教你正确使用Windows的Ping命令
[打印本页]
作者:
野人e族
时间:
2008-1-27 22:16
标题:
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
: y" T* X: }. S, E& A
8 @9 L+ R& T$ a3 S
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
/ T' X1 G0 `2 x/ x
& o, R1 ?# M+ _1 M9 [- e) X8 f
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
$ k; n/ }! n& M5 S7 B$ W3 y
2 |0 G5 K) O8 r- M
Options:
3 s% Y) f; I9 T) R. R3 Y( B
$ ]4 b; W' S+ v6 T3 u l
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
& I5 X. \5 f. n4 f" C
7 z. i2 O6 R; Q0 E5 E" E, \
不停的ping地方主机,直到你按下Control-C。
: U% i$ i' b" a9 A3 h
2 ]+ `1 h8 }2 e, z; S; N
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
8 i9 o1 G1 w! ~, z T
# L f5 {6 W9 A4 a3 Z; Z
-a Resolve addresses to hostnames.
2 r: n0 m1 N! D/ a8 h! U' C) l+ y
2 r( X( ^" D" w# e4 z- x1 I( Y- E2 M- ~7 i
解析计算机NetBios名。
# k9 e# c5 ?9 U9 ^6 Y( W* n
1 n5 q, R: Y/ G0 V
示例:C:\>ping -a 192.168.1.21
, S8 r# b* W, S
& }: C' n8 s4 u" z3 N
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- o* @2 D3 |6 [2 @: }
J: S- N4 j+ A
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 D. T( j0 `& @# O1 x' i
! o. y+ \# [# v- k
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 I5 B. U' k4 [, P/ A: @) f5 Y: N
% K- y1 g9 e* z$ g e( w5 b
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 R3 c1 W9 C3 x7 K" J0 A5 h# r
( r0 S# C* M7 J: Y$ c8 o. C9 M4 r( J
1 R+ r, c( [0 H4 d l
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* o$ L" o- y* L3 P0 {
* e. d+ c+ r3 h3 v% X& N) T
Ping statistics for 192.168.1.21:
& G9 O0 @* Y: _& A- e( ~: J' h
& [. E. b; @. ^+ ~
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
; I Z f7 a- D% J5 K- x
0 L) G' u+ ]" @
Minimum = 0ms, Maximum = 0ms, Average = 0ms
2 e& o9 D7 ]. T# `' G1 J* I$ l% Y
. l, E- [" c, V" d$ b) h+ X/ o
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
0 m2 i y# H* H: M3 Y( Q5 w
+ \% X. O& P8 r, M/ n
-n count Number of echo requests to send.
' }1 K) a& [- M3 K$ \2 v9 m
0 ?. ]! \+ n9 k* M
发送count指定的Echo数据包数。
5 {6 x9 e7 V* `7 C! l
' ~. P( |( c r0 M
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
. `/ X2 T9 g- u6 [
0 |& J3 o2 s7 v, d$ o, }# s) z% X) W
C:\>ping -n 50 202.103.96.68
; M* ]7 Y8 b5 Z) _- g' X
* g8 ^# U5 S/ m' [& m. I
Pinging 202.103.96.68 with 32 bytes of data:
0 F; F, ]6 `! }$ K; E( ?7 s j
9 Q ?7 x- ]1 x) t5 ` g/ L' D
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) I( x7 t# U" N/ p! A' P$ \2 q
1 a N* a+ |6 }$ X: U8 @) h5 p
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 U) v6 ]' `& T6 Y3 m
5 b0 l* e& l, @3 B% O5 S B& x# D/ J
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 T! v7 E" W$ d- b! M% y! x
- v2 F: R2 i. e' ], |6 h: U
Request timed out.
% I4 Z# L" c5 ~& J5 g. _
% t1 E; e5 m4 b; \3 W' R7 x
………………
% D9 h; L6 o7 _ }1 g
7 |* p, u2 T3 D& k- s
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 a# Q, A# `; J a( H6 b& t( j' z
# e" `# S+ I( Q% D9 e# x
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 z, g& @/ s' @
/ ^ S) x* Y" f7 u, |. P9 n
Ping statistics for 202.103.96.68:
: i" i) t! T, x- T3 f
9 H0 N B2 @/ i6 p5 m
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
5 f: W8 b, K! _1 E
4 y) D5 v& t6 ^$ a! q- s
Minimum = 40ms, Maximum = 51ms, Average = 46ms
& q7 N& d0 Q$ z6 Z8 ~
: j+ o( ?# ^3 Q4 L5 D+ a
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
7 E& g2 J% h5 |2 B5 Z
1 I- }9 t7 l5 U9 w! b; K' ]- {
-l size Send buffer size.
% Y# i/ Z2 a# P3 }
) s) p& U$ r5 r5 ?" {
定义echo数据包大小。
作者:
冷雨清心
时间:
2008-9-25 15:54
强大,但是我看得不是很懂!
欢迎光临 捌玖网络工作室 (http://89w.org/)
Powered by Discuz! 7.2