返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
" Q: J+ a  n5 S1 R, E1 U  
9 _2 U- }  u' L' f- H0 s  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
2 ^7 C6 B7 x  a. w  
  H8 t. Q$ z' W- z" ?. e+ Z4 s  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 $ h$ _9 W5 L3 j9 m8 `) ~
  
. w9 O0 _1 }  B% V  Options: $ _6 }0 h5 N/ E
  
' W6 I3 }7 [* Z$ w/ X, n  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. " \$ O9 M, u+ L! P6 T8 b$ f; u4 s
  
5 }5 p2 {3 L3 D0 ^4 v) }4 `  不停的ping地方主机,直到你按下Control-C。 * ]3 n8 o. I) H. a* J3 A% d
  
; p1 }1 B3 ]* N; E8 K. C7 z8 Z, U  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ; M% [1 r4 `& k. p. X/ I, n
  
+ r$ I% o# z( i  -a Resolve addresses to hostnames.
5 M+ Y7 C& |2 V$ L   1 J' ^+ R  F4 j* _2 g
  解析计算机NetBios名。
+ Y) D- q3 {( c   # _6 {/ W3 h9 d- O
  示例:C:\>ping -a 192.168.1.21
; Q) @8 ^) p' R; B5 c6 }% M. z   ! @9 x5 v8 R; H
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
  [/ j  A7 ^' N$ `/ [   & q8 [- o3 o0 w
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & A9 T/ l5 Q+ _# a: M- p
  
3 B+ r0 n! q: O* P7 h% F  R  x" b  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 `; }  H9 x9 E1 ~, D  v& d   & R; o+ {- I% X$ }' P+ N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' x* |* _3 l/ ]' j! J

0 C! b4 s" v* ]   " ~3 F+ O( x9 X/ V) x. X; D' K$ P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. F( ]+ h9 u/ G1 W% L; h) `   4 M4 ^3 v7 G* G! I' }
  Ping statistics for 192.168.1.21:
: W% D# r1 l5 X- M. U) v   8 ?# l$ t7 r" T: b  \1 Z1 d' }
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ' l6 G* v, I7 k
   - F1 [# d# h$ x
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ' J- C% N" ?6 T/ X
   - d2 u- ~: t- Y4 g8 Y& J3 Q$ a
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
3 r; U6 ~6 }& J  
$ t& [' q  a' A/ Z3 o# O8 M) Q  -n count Number of echo requests to send. ( Y/ K2 ~. O2 a% P( w
   2 x; O$ L* \3 t0 S/ k
  发送count指定的Echo数据包数。 5 g7 u0 M. Y  X. S; @* U
   ! }2 X+ W1 u' D1 m% u+ k
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; u: [/ n5 ]5 t7 T) |6 Q
  
9 {+ l/ X2 W& E' F  C:\>ping -n 50 202.103.96.68 0 Y8 i! X* C+ _$ i- L9 x" W
  
2 q. H* ~0 h( L, q0 C  R0 ]  Pinging 202.103.96.68 with 32 bytes of data:
& G3 d2 i: ]8 W& r5 J/ \+ R   , _6 m1 L) P! [, @) l! e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 `7 G$ Z( F" c* k' x& s& \8 r
  
$ J0 L$ \% `6 N, A: |  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" c. c( \1 ?# ?+ M6 {. ?  
5 |) Z7 R0 O6 j+ D* @  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 L7 D! P. _1 u* g8 a" @  
9 f/ h9 e' x! D* I6 ?  Request timed out.
9 v, o* A% J9 X" K4 y   ' l) U! i  X' S( T- ~- R# N1 f, ~1 Q
  ……………… 4 `0 b- x) r: }! {
  
  @' @- \7 ]) Z- E5 K3 B  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 [  K" f- c+ z' S7 I; M) P* ?; X  
% t* _. k; V4 h0 C/ Y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 A# G. @7 ]# @% w" v$ t0 W6 T
   + `# p) J5 Q, i2 R: F
  Ping statistics for 202.103.96.68: " P: W/ [0 [8 j  i
   : P+ }% |2 L) X, x
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
9 e+ C; ], K; O! |3 s  
$ N" q& A1 g& ^+ ~  Minimum = 40ms, Maximum = 51ms, Average = 46ms
( A  e7 f. R  B3 \+ E   3 f1 g* f/ f- e; T
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
  F. h2 J+ z$ Z: d( C; U) o   * e& W; M5 m; U# ?1 f8 H3 m
  -l size Send buffer size. 6 Q! d" Q- A1 {7 w( v; i% I  R: Q( l
   : D. M/ J; m$ E" b/ ?* ^' ~4 @4 O
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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