获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
1 |/ W' l% s0 \. j  
2 Y/ J6 b# S3 ^2 a# X5 O  @# t  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
. @5 D9 o( x- Z   ( [6 x& x7 ~' I. y7 A5 Z; m
  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 # k& P# E& {' x. M3 ~
   $ c$ A' g: `# {0 H1 J, ]
  Options: # _& ~8 M$ g! q2 G. q: S
  
9 D% f' H* w$ b  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
% D- b( P( ]' e   6 G1 j8 G8 I7 M" Z2 x: x
  不停的ping地方主机,直到你按下Control-C。
* ^1 L% X1 e7 D0 @; D  
  m2 v4 q% v" W4 F' a! F( o  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
0 O& U- H. @) P* n% n3 w   # t/ A3 Q1 x! N4 o% H& Y
  -a Resolve addresses to hostnames.
1 G/ [% h; o& }  
5 G) @3 K: A2 K  P) T. S  解析计算机NetBios名。
; o1 j% q$ r% j9 g   % u: m7 o& Q2 m3 r! w, e4 w
  示例:C:\>ping -a 192.168.1.21
" [! D: P: ^% w5 q- J3 K: j   / t$ S* H( b) r0 T
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 `. w+ g3 [: o! i  
( A! W. S7 F& I+ N/ u! T" K2 Q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ N. _& p* ^- r& \  {& m  
; m, m0 X! m# I- M& ^  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 G! |9 V  @; }; o" a+ |$ z
   $ s4 {' I( J+ N7 Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 T( Y, j. ?/ i+ M3 H' b
8 V( w8 m$ F5 d8 G, O* Q* w   / r% {: }, X0 N4 z* S7 f
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ G2 `8 K9 P3 Z9 p
   ; O$ ?+ U6 K2 V7 f  J& a8 e
  Ping statistics for 192.168.1.21: - E5 s- D* |: m4 O
   5 d7 R0 {+ y0 h
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
" x5 y1 J# q% Y  
2 g# B' t! h( ]- u# h" ^; X$ y( n  Minimum = 0ms, Maximum = 0ms, Average = 0ms
$ s. {: e# r9 @! U' N1 `- N  
. q' Q0 P  A9 V' E1 g( l) Y; a  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
4 P- Q+ G* g4 M/ Y! P   2 _. Y4 M4 I* N0 @% V" o% C
  -n count Number of echo requests to send. 3 s- h" B: c8 X5 B
  
) M( u0 M: b; y$ [7 r2 u; V) ^  发送count指定的Echo数据包数。
+ J/ Z2 \# G3 C/ P2 w8 S- x% d& j  
0 L) g. p& M9 q3 @5 [$ e; Y  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
0 ^3 @) m! `+ |# S6 P! g  
- }) @! z' I% |* r1 [6 e  C:\>ping -n 50 202.103.96.68
9 }/ Q6 t% _1 t   + C$ K5 y/ h$ q' s$ t1 H8 o- ?
  Pinging 202.103.96.68 with 32 bytes of data:
0 K3 d! t- L4 v( v   ' Q4 m$ X" m8 B, _: J# f6 q6 T$ H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ O5 l7 F; ~4 C/ m, }+ X+ `4 b   $ {6 b% Y4 F3 k2 [/ H- m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 W$ r3 p( ~" ?: U  
: E0 F& a8 }3 u. w5 M0 Z' U$ n- Z/ ]  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 C9 D) f7 N. P9 M) R. v# ^
  
1 z5 O0 ~' p8 p, [6 ?- Z3 S9 F  Request timed out. ' s6 O) Z6 H& x4 a$ D2 p% ^
   ; P: b- {7 }. I1 ?6 K, o# L! T
  ……………… * ?) D9 Y) T/ g9 U$ v! a+ n9 J
  
- j( f5 O( ?* Z  I  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% _5 F- b) r" s9 \# u   & C& L' J0 G6 r3 L3 G5 d
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 w* b; c- [* h) z- _, }
   + q% S, D, W; r1 f
  Ping statistics for 202.103.96.68:
$ R/ `/ }/ ~9 }/ {7 O: }  
7 P1 g* r* z% A/ X# G1 M9 n  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 4 e6 U4 M* U% W7 G
   ( ]+ t7 Y, q( l( C& }; b
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 3 c" T1 h, j4 |- ^& {. z$ w
  
" {9 O/ v9 f) e% |& `) s* {5 R7 B  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
8 d( m& z9 A' m2 V6 C% S  
8 |. M& p# V) G5 q1 d0 T2 F7 `  -l size Send buffer size.
8 Q/ z6 A$ c4 I4 S2 F6 ]% _  
0 S; y: e1 g) Q8 g1 n5 d. z  定义echo数据包大小。
89w.org捌玖网络

强大,但是我看得不是很懂!

TOP

返回列表
【捌玖网络】已经运行: