|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
( b$ k7 @$ l( q$ ` ' N2 N. N1 [& h: H$ ]
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
3 x3 ]3 g* W9 p, o" t# D/ |1 d2 F * t% i! ` z8 n) G5 T/ K
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 ( X! }5 c: S# ]- S. ^4 I1 c
; b0 r! f J8 r
Options: * I3 m. x; p7 [* H; R! x9 p" m2 [
. r- f! S" V5 j1 Q -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
. R) D$ D8 P. Q9 g* l- Y8 U
4 e0 w; n( W6 w/ o. n9 R 不停的ping地方主机,直到你按下Control-C。
7 d- } h+ M1 a$ @% {7 H$ g2 S
% G7 V$ k* c/ N: J$ j 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 , a$ a7 o5 U3 f6 j+ `) S
+ W6 L) C+ i2 p* J3 C -a Resolve addresses to hostnames.
0 u, V7 _) C8 D " r8 }. w1 h1 e9 j9 T' K
解析计算机NetBios名。 / H0 m9 b, D J+ n$ u! o7 R. H
/ Y4 v( D/ [4 T' K! a2 w
示例:C:\>ping -a 192.168.1.21
! R6 d8 B* F0 b+ {) k) u1 w4 y
' U$ i" k, F) E+ k% G Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
* u! d/ K0 R% a" V + w* w( M9 K2 Z3 a& u% R
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( U5 e( O9 E8 ^. ~2 j
1 f" p; Y) N! n; z0 u6 b& w Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 K9 B) T3 C7 S4 D: @6 N8 \: K
. @: `4 i5 g/ z" c8 k
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * V3 N+ W$ x0 v4 `. d/ \1 s
7 e9 g1 V, ]3 H1 Z # D( B: N$ p& R" U9 w
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 d$ f0 a# G; d- g4 R8 a
# ?# z) k8 c' J- G. n Ping statistics for 192.168.1.21: 2 u- Z+ n4 V# @; e4 Q0 \2 E7 ^
4 C3 |6 c7 a% @. w
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
" l0 |' w W) S; R$ @ # ?" n% `2 ~; f& B4 h
Minimum = 0ms, Maximum = 0ms, Average = 0ms
7 W# V: s1 r( |$ a# W: D2 h, W
/ P/ X. {5 ^4 B0 r1 S- U0 L9 Y 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
& ~ z$ D# [ V9 j 5 n% O: b B4 \0 n+ P+ h; A, P
-n count Number of echo requests to send.
+ f4 x6 Q& `2 ` $ A) J- s; R. W
发送count指定的Echo数据包数。 . |2 p4 C: i/ D* H
( F/ s: C; z! a1 K2 k
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
' I# U5 _* z& G. p+ s+ n & y) x) t: L4 x0 C+ t& d
C:\>ping -n 50 202.103.96.68
1 E$ N |( {" p8 n& o- b
: M* a* W2 w" m: a1 x Pinging 202.103.96.68 with 32 bytes of data: 9 K v, |0 q- s3 l l, }
2 n7 B U2 _7 e9 l h# z' J+ k; M5 e- x
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 U: Y- V4 P/ v$ H, @" h& p
7 D! c$ {! F5 Y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % a5 A: r" v' i( G) m/ p" h6 ~
: q! a9 Z3 L* j9 N* U* i Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 L$ ?) Y2 r8 y, o6 z$ o
7 a1 i( S* e- l' L Request timed out.
+ O" Y. D* d( f6 W - F. v! a1 Y8 ^! i$ t9 x/ S
……………… l6 n( l% V' U2 B
& B& L; T5 H% P1 A
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - G# h. J8 v1 q* s) r& L7 h) }
3 m- Y4 g4 h3 G; _) {: R, v Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 ?6 @7 S6 q# O# |/ j# B 5 ~' o$ ^/ }8 Y: ?: F1 V
Ping statistics for 202.103.96.68: + K- `+ v3 v5 d9 f
3 e8 M" _8 ?! P* B& O: n
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 6 t4 T C+ i2 ?
9 \; ?* K- z+ i' L. z Minimum = 40ms, Maximum = 51ms, Average = 46ms
1 S$ a i" y9 s3 G o; n9 q) b8 b1 W 4 z6 S1 N* b, j+ n- n; y$ @
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ' L- G3 |& f! Y8 f& j9 c
& y- v' S" `3 u/ R! B% C' U -l size Send buffer size.
9 g0 m+ f0 L2 D1 U7 o! m$ B 9 E' H8 U, ?8 H8 Q+ n( u
定义echo数据包大小。 |
|