|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
* E. u: k Y9 L% \( n" Z
# R6 G, I X0 j. G/ ] 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
5 y& K5 s% U5 A) P8 i+ m* n
: j8 r2 ]" ?& L/ G! A 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 e, q& y" C* g! }7 A4 V+ n
! q2 v- ]( h @# T! D. s Options: 8 y* v: g" ^1 e# e
5 D+ F+ I8 B: j: y" u( S, s6 O
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 H. e9 j! f* t/ ]" {& a1 q
: n/ S! G$ }0 t, y
不停的ping地方主机,直到你按下Control-C。 ' U _& \. V+ O& L1 h! v1 U# u9 e
- ?0 ~' q' s7 e$ s, P* ?9 D
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
: i7 Q" R& N' c- c " o; ?* s; e' x* t
-a Resolve addresses to hostnames. ! s% s# ~' ^3 d2 h7 i0 n1 ^2 Q R+ r+ ?
& y: s {5 c4 u$ @/ U' j0 x 解析计算机NetBios名。
: s7 o' T2 ]! y/ ^; D. O + b$ y7 x( W# m+ N: Q
示例:C:\>ping -a 192.168.1.21
$ b. q2 q- d0 d: ?7 W
% I/ h7 @0 d$ i+ p6 v% F0 C Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 3 T+ {- ?- r/ i* E$ c( s
( [0 k2 X1 l0 R
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . b8 O: J8 X4 L
# v' Z$ L5 H- x+ L3 L# E
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 m. j- ?8 x3 Y( a6 g* w/ K6 v0 P & w$ r' q/ u0 j5 z" ^- q
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 _1 p: Y5 Q! Z8 q3 h- k9 G% o
: k" C* D( L6 c9 z( A
& c \! g+ Z# m1 s( w, [$ M Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ C2 P9 y+ q& ]
5 ~' P1 h" t9 k# f. W1 l, o$ J) G, _1 { Ping statistics for 192.168.1.21: R3 [4 ?3 B6 c" m) C2 M& @
9 n! W' q1 G; S b( I5 P. o
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
% l& _9 @9 V4 e: X) r
# U* H0 g5 N j) x+ d( E1 c- b Minimum = 0ms, Maximum = 0ms, Average = 0ms " X+ y0 B5 ?. Q! l+ P' m. U! n
* S2 u' [7 \" e 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 1 w1 K0 m; c* P* N+ l) N/ G) \
+ ?0 H- t1 x U' H7 H
-n count Number of echo requests to send. & O7 h, ?+ h+ m* x N3 K
; Q* Q( O6 O5 C3 X
发送count指定的Echo数据包数。
, k6 @! w! V' B, W3 A' P; s5 } 2 d; ]- n6 B0 i9 M
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 p3 P4 P9 ~$ N- V/ ]
& U' \; l6 y; W/ K' I; H" { C:\>ping -n 50 202.103.96.68 ( D- l8 ]* |# K
, v+ ^- n6 `; `3 B4 @
Pinging 202.103.96.68 with 32 bytes of data: ; K- _. a. c4 y. [$ e4 e, z
& W% p X2 M% E" _: U: m Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 ^3 _1 `: I/ T # \$ J( \) }: b2 r( b
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' J' E1 Q4 d0 \% G- J6 ]1 }, h) x, O
! W( Q) ~0 `- s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; Q8 |. c! R, I5 |: F2 `
) A/ r9 X; ]. L( w7 q Request timed out.
/ k: E2 e4 i/ D5 _ P. K" ?* } : d3 k; X& u4 v8 Z/ L" y4 K9 @
……………… 2 t1 U! Y$ x, A) A J
, {6 C f2 A& b5 d' C) w Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % [9 `( `9 v8 Y1 ~, U; j: b; F: U- t9 v
; ]+ ~# [! G5 O7 P4 [$ w
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; [/ g1 K1 p& b% w- F
: ^% ~( A/ a e/ D+ l Ping statistics for 202.103.96.68:
+ X2 ^% G' k: J3 H2 z; ]& x" K 3 g" l" Y! j* [7 \1 j7 p
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ( g$ h0 q/ b" B! J: W. o9 c% B- I
. L4 ^# J& {4 n7 C! C) } Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 _$ x1 v3 Q0 F- i
) G6 z' P% @, C- d' x1 x 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
. g6 q3 E& a N+ \8 t . o, J& V, v! u: U* B9 ^* v$ f" C
-l size Send buffer size. $ J+ u* M4 r; k. B1 \
9 w7 S5 D! k7 I5 _+ K* c
定义echo数据包大小。 |
|