|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
. c& R: N( E% {% A% B
' T4 m3 @3 i1 L" z 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 8 N+ b7 N4 H/ l H/ t9 q
/ p* _$ |) q+ s, P [- ]& c 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 3 k9 Q/ X0 @; i0 K* i6 `
6 {$ `3 C) X) G* A
Options:
1 y2 z$ @3 v. y- f' w6 |& O7 r' B
$ E/ ^ a, B. b8 n# k -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
. p0 F# P( e6 G: m8 G7 N& e
- h7 J+ ^! u3 I ^8 M% B/ [/ T 不停的ping地方主机,直到你按下Control-C。 9 [9 K- u& e7 q' P7 N/ B/ @
% P. U7 ~: p$ E& i- e 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ( V2 W, o0 D1 N, q! C
# ]% l3 w7 u) g/ t$ ^) \% r; }2 j
-a Resolve addresses to hostnames. ) t& Y3 B; r6 l6 U" ]+ j5 l0 O
, |( u" C. y) s$ t; f1 G
解析计算机NetBios名。 * w2 ?% A1 K, |3 u$ R, j( i, c
+ a- d& c! a: ?$ }! [+ b 示例:C:\>ping -a 192.168.1.21
& e- [/ Z* Z9 ^. N7 G# X( L
+ l; N, b6 s, L Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: H# C. c, |, n/ A6 S8 G
; B& E2 D; C; O8 W0 ]- Y
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 S; q" c( l3 d- _& j
" m7 L% v8 w& V1 j+ W7 ]% s Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ _' Y+ a" _1 a. k; d
5 Y- U. F2 |/ g2 m ~# R; O* g Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; r/ i7 {( {2 A5 |4 W
' l5 J( R7 O7 V1 I: H9 }
3 i ^* }8 j" J0 D% Y; E Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . [5 N) j: C4 e3 A& S* E, f% }1 I
' B, k' i$ X4 S/ O* S H2 n Ping statistics for 192.168.1.21:
+ w; w" i- A0 W' E
6 u' z# _9 M6 I+ l& ~ Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: - ]. X; X! A6 {5 b3 {* a
! @$ e3 r& f0 J, L) N+ E/ k Minimum = 0ms, Maximum = 0ms, Average = 0ms
2 G4 S/ W6 ^. C5 m# m: { {
8 e1 G) h8 ]8 ]' {" f( Q 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
' q1 z1 }. j- e/ K: D) g & E$ K; r+ r! r0 O+ t
-n count Number of echo requests to send. 9 h3 K. K" Y3 B; ^6 k _0 w
& U+ {6 Y4 F7 ~) m
发送count指定的Echo数据包数。 , i z; s2 l- X; Z1 n
& l4 T# T/ Z8 P1 U- h9 {
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 3 ?8 h( P! ~8 W
) H1 D2 C+ k9 N* u
C:\>ping -n 50 202.103.96.68 ( G8 K0 W- l- J; W7 t
& R$ T& z+ g* U
Pinging 202.103.96.68 with 32 bytes of data: & j5 ~2 c4 v" |' z
0 L, S$ k, t# |$ I Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & x# ?* U7 P+ l) x( b. e+ \8 Z" G5 S
/ `: `: X4 m0 I Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : X1 B' W1 L' y% D( C" U8 B. ~
: e' h3 d2 U% O2 L) j6 c9 p1 D
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 l# b) s% \- j! U
8 `# o1 j0 ]9 l1 c Request timed out.
# }% @0 ~; T( m5 I5 X
( E: {; Q, O5 v& G& v) h ……………… ' M; R* q2 T' }8 r* }7 j; g
( N' R; f! _' [- r. ^ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" [1 m& g1 E- ?4 O. e 3 r; |! s) b5 |5 P$ r
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / ^9 N! n, i' Z8 G6 c+ X" t# O8 H5 W0 L
$ \9 D' o$ D7 l" t, H Ping statistics for 202.103.96.68:
8 B) L% W. A" W1 F8 S$ t+ u 5 V: V- J& d, l1 ^
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 5 u# d" C, x1 R
' Y$ c& g Q7 G& b
Minimum = 40ms, Maximum = 51ms, Average = 46ms 8 ]! R8 b- C" o$ l. z
4 p# p1 R0 }" t4 a/ y8 z. K, J
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
) a9 i% ?, |8 C+ s( ^6 |6 x % E. O2 j- ~1 v% M$ O' V
-l size Send buffer size. ) ]1 [( e/ m# e
5 c, {$ P: T* Q# |
定义echo数据包大小。 |
|