|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 " I0 P: d, a* z$ D8 Z0 G m( Q
. ^, F! I; J& T' h 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
+ a A) c% Z2 s* l& @
2 ~0 f3 M4 r9 t% I+ V( ~( w 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
; O8 Z9 b6 F& X7 |. S+ _
m4 K( \3 \+ L& s: M$ m" l Options: 3 _3 l: d2 W4 i3 I/ \8 O
/ ` L% k; N- A" E4 [$ v& @
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
( n3 h. v5 f M, N# t# i1 T& q' l
$ z& R/ C+ S: _9 I# ?1 C% [$ s) L 不停的ping地方主机,直到你按下Control-C。
- |+ d, w9 J/ o
* K' q6 C+ n' i$ G/ s' |1 L 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 3 _+ o. d3 p) u0 T
# m& u4 L8 g, F' G -a Resolve addresses to hostnames.
& V" K) X7 Z! @/ V $ V+ G+ f6 N) x, J2 o
解析计算机NetBios名。 ( _0 m" N6 ^# \3 ^. e, B! p; W
% E9 f: s4 P# X1 A 示例:C:\>ping -a 192.168.1.21
+ g6 Z+ z: P d
) |9 X3 }; ~0 ~( _# i Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 |. Q5 N$ S6 u $ ^7 y9 g3 j( G$ n
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 {7 S U; O/ k% O! `
8 L3 L, I" V$ j5 p3 Y' K9 G1 _ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 B( j2 |1 u( f M2 m6 |9 V! ~5 v $ R( ^/ t/ l5 E2 \: Z6 F
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ D# I& K( b7 l3 m1 L
3 } q; O- F! M8 h% n
2 `4 K3 X! q9 J; o Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # @8 S* R/ ~( s$ N( z
1 W1 R! n7 U$ L- s( n
Ping statistics for 192.168.1.21: 2 _4 _( Y# u! h
, w6 L9 w5 K( y( v* d" e; W Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
7 I9 \" J7 k' l( j( S( N6 D4 M
; {. g& E2 R0 D Minimum = 0ms, Maximum = 0ms, Average = 0ms ! {4 ^. b8 R$ Z9 [
% S+ t9 l# G8 I* F; g 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 # `6 H4 y' g' \1 J& K
1 a7 P4 \0 n+ z" b3 S -n count Number of echo requests to send. ' S) w. \- X, c' H* \' ]/ _# Y$ W5 a
2 W2 K' _' N8 @/ t! l
发送count指定的Echo数据包数。
6 Q' q, P8 \$ n; ^- X8 Z' M
" }2 ^3 J$ g2 B0 v5 | 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 4 f' l4 }* u7 e7 Q" J
1 W% V2 K" g) t, e" d- A! m: c7 D
C:\>ping -n 50 202.103.96.68 8 I9 L0 `* X6 s3 R% M
. K+ w; i: ]3 D1 s: S, s1 Q
Pinging 202.103.96.68 with 32 bytes of data:
6 S: Q7 r/ B( ] - _4 \; B9 @& _8 f
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ U! D7 O4 u* t9 P
( k/ K3 ~' m% J Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 a6 w& O* i. G- s, y7 m* Z% f9 W
: ^4 x5 I; d8 } Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 [( i. L, j9 A/ d3 ]5 j 7 u5 Z% [# P6 U' H! m" R4 @
Request timed out.
1 Y0 D3 O- `6 y / C5 R- T" S( F) s! M
……………… J' u2 i, S: p
* z. \+ W* W# u" j9 C& Q H Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 }* @1 ~0 q) w: {. g
" j9 Q4 K9 [3 A! ^0 i" o0 _+ |4 D* M# l Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! \5 j1 |& g* ?9 C: H ; K+ [+ J3 v8 S& g$ m
Ping statistics for 202.103.96.68:
* B D9 k- I; z1 h! s) G
+ J3 R- T' ], r7 w7 H$ ? Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
4 v" a* b+ l% t% Q$ B5 W: ]( d8 R; m ! d: Q3 x, u' R F
Minimum = 40ms, Maximum = 51ms, Average = 46ms ! ^! g; } d- c
+ w) v# k W: Z$ D5 A" c/ h
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
' A0 }. w% U k/ A' l* p- `3 R# Q
& u+ b. Q* a/ P0 J, ^% ] -l size Send buffer size. . ]" c: l w" a7 e
g% ]5 F8 X' A: W+ _" U$ E
定义echo数据包大小。 |
|