|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
' [0 T7 X6 g3 u' b) D 9 d1 M* L; p9 v/ r/ Q) v/ o" Q; [
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
0 Z+ n$ E* g- O/ S
3 H, ?0 [3 N0 | 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
- l3 v9 J5 ~0 I2 A4 g
8 {* l, x5 _. R2 W) V Options:
7 c) q. P3 H' g% f4 r f & l$ l4 E9 D, A' E6 e }0 r: k
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
4 f; y, X+ U' Q3 F8 s; l
# g( n3 |+ j0 ~ 不停的ping地方主机,直到你按下Control-C。
1 K* H# r7 x4 M # v- ]/ S) m2 G# Y s, q" u
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 l$ O" H$ u& G/ o
7 m2 r7 X1 _6 Z/ @ F& H% @" r -a Resolve addresses to hostnames.
/ n }$ T: g# D: i0 D1 S! _- k # J% `3 S, J' d
解析计算机NetBios名。
2 r% N) X# M" F- B
* N# w" A5 v8 O% I 示例:C:\>ping -a 192.168.1.21 . h8 |0 ^' T1 e1 u g
/ f1 o6 U0 P% |/ c Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 9 |. n! B+ u' t& c, ~# p. W& M
, U1 j" T3 X# e ]0 L! R Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' A# a5 X% N* ]3 `! V- U
4 n# t, x2 X; _/ T
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! }' Q# j" H# C: x' z! \
1 p& G# b O2 y3 H7 ^1 j: X6 B Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , y* Q, b: T) T0 s- G0 l
) } x5 k2 S0 |4 F0 y9 r: h+ m
: O. N8 I. X) F# N* E
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 z5 |6 }5 S2 p
( @1 H- n* X; G q: ]9 h0 n( Z Ping statistics for 192.168.1.21: ' B7 M( B# i( |
# o8 G1 X3 i G Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 8 O/ O Z5 V! O9 \
) ~7 L7 g' q) p" K5 ] T r4 ]2 `& z Minimum = 0ms, Maximum = 0ms, Average = 0ms # U) ]8 G: {; A2 n
5 d9 D0 r) O& Q \2 Q% t( J; _% R 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 6 b' _3 I* A2 P
9 O& @& n3 z3 S3 \ P
-n count Number of echo requests to send. 1 @" ^* Y2 \# r/ ^4 ^ E8 ?
F; f% I3 o2 U! i5 o/ a+ C
发送count指定的Echo数据包数。
! s$ j# X8 L) A- D, P; ?$ k
) o* z5 \1 K% X3 M Y 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
8 ~7 u+ w& Y* d; k% `9 f) o" M 7 C7 ]# U$ b$ U; w+ [
C:\>ping -n 50 202.103.96.68
; e) y C5 H7 Y/ } ^0 C- C & M" G% }! S, n( x2 N( O
Pinging 202.103.96.68 with 32 bytes of data:
5 i; u$ o. d5 z8 d0 J4 A- { ( U. f" W( `4 u' Z& u; e1 l# L
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: s- R3 S7 _0 i
6 B- ]. b+ } @; u Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , g: G3 i+ `8 Z& p9 T
, ^3 }- A5 I+ O G4 N5 Y& a$ U
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) a: N0 w Y, u1 }4 x' C' D
" ?' n4 D9 b; U7 g1 d4 _ ] Request timed out.
5 d7 C+ a1 z9 l M2 C k( e
/ f- Y% _! J) V y3 O% |# D& _ ………………
1 y4 N0 h9 X) p2 |/ v: u
/ i$ ^& Z' W. B5 a, W' Z Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 d( C2 I7 a& ~. o/ f. x/ n0 Y
* d& B5 B) O" L3 }) Z Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : o" u, ]9 _; \$ n& t9 C
% f8 b; r6 w6 R. f( y! M( T Ping statistics for 202.103.96.68:
7 ` n* n! h+ C1 P
- [, t, u) d( v Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: # X$ H' ?8 ]8 t
4 m& i+ k, j7 {* G R" D% E+ L2 U
Minimum = 40ms, Maximum = 51ms, Average = 46ms
* ]) _$ |7 L6 I0 L+ A
2 ]5 I) I# m5 ^/ B) {4 C 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
. @1 ?" P- J1 a p d
+ @7 q. z. b' u2 B. y -l size Send buffer size.
' N) J6 p& j8 d. b1 G2 L ) t4 b& q S6 v) S- J) O
定义echo数据包大小。 |
|