|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
8 _- g( b3 Y) C/ W+ U" G
$ @5 m) b$ ]1 u- | 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
+ h. z( y$ z# V" E! Y
# W0 I: ~6 j( ?0 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
, g0 M4 t% N$ g, j h ) ^# [4 e: e. E7 f
Options:
# J- c; j3 u9 g5 Q# T
( ^2 H* l1 P( N -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( r1 b! k# P: g9 h
6 c; a: T: [% P0 ?/ L- m5 Z/ W. k8 A 不停的ping地方主机,直到你按下Control-C。
, a8 B- N+ N/ C9 R, |0 z
% R9 Y3 N# b) m, Z, C 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 4 h; H% z0 d# c; j) q' x
; s- b( K0 \% q$ X1 M -a Resolve addresses to hostnames.
, l. W. e- |; a- W & i% O# |2 M N" |
解析计算机NetBios名。 6 y" M3 l6 V! A& T( y
9 V2 p% P& W# ]' @8 ]% |
示例:C:\>ping -a 192.168.1.21 8 \* ]9 a+ z2 r6 d7 w8 Z
( G, _8 |5 _9 a7 j' V
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 n3 R; u* `3 h* Y y. c# t , n! k, l0 h0 r" [$ A
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 i4 F6 ^8 C* y$ N" l: v
0 p4 ^- u# Y5 L6 i# M- t. k9 v
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : A2 s6 T6 i6 Q3 [; ]
3 ]: ]3 |( B, {9 ]4 Z. c
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ r' K# e: ?- ]& Q* M k2 e# {
" g: N' `8 q, v! {& L
, |, [# _5 O- V: L Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # g' q/ z, t' ]
& J7 _$ G; C) P) F3 H
Ping statistics for 192.168.1.21: 6 b) g9 P* @. N* Q7 h7 A
0 I% Z2 V2 P; ~) X Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
: R. ~9 ?0 o2 Q( N % R8 j/ D" p7 i3 w
Minimum = 0ms, Maximum = 0ms, Average = 0ms S+ ]0 \$ r+ M: q& \8 @
+ w: x$ B x, f. @ 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
u+ q9 I8 w) `0 n 4 h' j/ t9 o* `# [
-n count Number of echo requests to send. 3 W9 y7 _$ b+ |, i- z* k% N$ `
8 P+ V% ~! J8 ]' y6 ]4 x' s* I" y5 ^ 发送count指定的Echo数据包数。 8 ]8 w; _( ^5 S+ T0 p4 r
. @7 x) {$ b" \" s 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
% n: G ~0 d. k. g" V z" j" h$ v8 }
8 P0 p5 }9 l" z2 f. E" U0 L3 w% N( O$ ^ C:\>ping -n 50 202.103.96.68
8 Y7 |# H9 o$ _+ {$ j) Y: M 9 Y' S2 H0 u" b
Pinging 202.103.96.68 with 32 bytes of data: 5 w% R, C4 u1 B( q5 p8 L
+ e ?1 |2 D9 o- ?* u: P( g/ o
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% q& R ` m5 J, U. y
8 E6 q# z- l( P w Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 q4 ?9 x) a' x/ G
: G- G! a7 Q) v9 h* `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 C$ u+ a0 E" U# P0 u$ |4 L
" B( t5 B. Q8 L2 a
Request timed out.
6 S+ S3 ^/ e3 p/ I; X
" a% o9 ~1 `: G# N+ { ………………
8 X" }2 h6 ]9 ~ 1 u9 w+ O, z0 P8 Y- T
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: R# W, W3 `: j+ x8 K9 }
d+ U% m! m( W' |% d- F9 g Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 n+ ~0 m/ }% a3 j, O) I: s
( {) M8 U5 w9 w8 { Ping statistics for 202.103.96.68:
9 u; W5 _- S6 `. f, }4 C$ ]
0 \* s) ]9 P: r) w* Q. C/ d Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
! Y: b4 o3 L- n; v& x
$ Z" `: _5 ~* b) e& a E Minimum = 40ms, Maximum = 51ms, Average = 46ms 2 P$ z. N3 ?! s3 z* N4 U
2 T) q3 J9 x8 v4 E 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 - T& G3 j; c6 e7 ^ Z' T
" m* V0 O' [/ C5 }$ I# {
-l size Send buffer size.
# N; I! [/ x* j' b/ M " X' J' V- L/ l+ z* s! a
定义echo数据包大小。 |
|