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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
' y' E1 u+ \2 [  
) Q; ?5 N" L# q& h& ~% V2 f  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , r- f1 D" b) z- }( c& |
   3 {) M6 J0 A* ]& s# N) g' O
  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
" O# B0 f( B' {6 }# A8 l' u' E0 v   # F+ ^9 D/ w- n3 O
  Options: ; N& i1 h8 k+ M" X6 W1 e
  
# h5 h2 A0 D' i2 |. j1 p* R  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - P: z3 ]+ R" e6 i' Q9 n, a5 ~
   & ~8 ]3 E) U# z, z
  不停的ping地方主机,直到你按下Control-C。
3 c$ M. |8 ?$ y! L' x  
" \, R* j  U! H  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
3 i  T& f0 v2 @/ S& d% ^  
+ ^9 _2 b8 m7 Q0 `9 z  -a Resolve addresses to hostnames.
8 D! x5 M/ j2 W( t* C3 s  X2 e/ _   ; n2 n) ^8 S* x. e% s1 k2 `) I4 ^
  解析计算机NetBios名。
1 J! A$ a/ A* _6 V( Q   6 c* P4 r  I4 k* B; ?
  示例:C:\>ping -a 192.168.1.21
  G  ?$ M$ z+ O: ^% e/ |9 D  
7 b! B2 {' W% k3 M3 n) ~  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 0 ?# K4 d: p, d$ y5 k$ a! Y9 ^4 \
   ) Y. N7 x2 H6 s6 l, U% ^
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 P* y) \* K, `( ~0 F9 E  
3 B2 d0 H$ E9 T4 Q$ S" l  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, ]3 b1 R: ^! c  
3 C  W( C" ^# Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) v: I- q+ \. C( A+ _7 `$ y( F
+ Y- \  `5 e4 w' _
  
+ b6 ]$ K& E3 G* ^; c  f  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   G' G5 s* O# r
  
) G  b  o% W5 u  Ping statistics for 192.168.1.21: " Z4 c7 u0 [$ F+ k& h5 J
  
) H4 t- @5 S& a1 A( H  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
; C& S: w! |7 E6 A! H1 l9 U  
- x- X2 l2 k( M" X9 O( d  Minimum = 0ms, Maximum = 0ms, Average = 0ms ! a" B* j! J- r4 r3 F9 @) `
  
9 H6 F2 L2 V2 Q6 t# `* T8 ?: [! C  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 6 F  T# ]  D% |7 l9 X
  
7 w+ W+ X1 I2 h( k' C: ^6 T  -n count Number of echo requests to send. , E$ V# ~# l( @6 m) }
  
7 u) N0 r. l; b+ z% V; O, u" {  发送count指定的Echo数据包数。 7 ], O5 G( J1 @5 Z; x; I4 w
  
! y, H- ^/ b: u; L% N  V: F  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ) D+ ^' X$ }) E* n5 ^
   4 f$ h% D$ e2 U; K
  C:\>ping -n 50 202.103.96.68 & J2 f6 {, z0 u
   6 [* d6 m. n1 ~- h' @6 I8 c; u- B
  Pinging 202.103.96.68 with 32 bytes of data: 0 [- p8 K3 T: c7 u1 _* g) k
  
) c4 t; K' d  D6 ]6 K  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 e+ c) S# M* H  
/ N  t' V! B+ o/ _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / r4 P# r6 \+ U4 d# @3 o& f
  
2 e+ E# s8 Z0 A2 N8 K& u  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& _1 M8 c  d! Z8 _" i# ^9 |   " P. N+ B4 u  |' q( ?$ F7 d
  Request timed out.
+ r0 h# u# Q+ Y: R   & w7 k! L- C1 s8 S, J" J5 D8 Z
  ……………… - e# _& g% m3 L: C7 O4 T
   1 O3 ]( t8 n) z) P& F4 k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" [6 t# o* j8 v- m, h9 C  
0 i. n( ?8 ~7 H9 i/ G) `  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % O6 T8 w' |% V* Q
   " H( k7 l+ U) r* s! }
  Ping statistics for 202.103.96.68:
2 j0 {8 v3 r1 I5 T; c0 t& _: G   " w' B# a5 e5 U
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
4 D" L; @. _# p+ _( c; T& Y2 b5 U4 h/ r   / j5 I2 q) r% S1 c0 L% s' {
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
; s% P$ }8 f/ d  
( ^+ @$ _. ~% ^) b6 q8 ?0 l  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 + o7 {7 k" Q) v
  
+ c3 G: @9 t* I) l: Q+ e# Z* V1 V6 S" g  -l size Send buffer size.
" p1 Q2 O2 B7 U* \$ C0 w6 O' Z  
/ |) h. K9 W$ |5 d  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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