Board logo

标题: 教你正确使用Windows的Ping命令 [打印本页]

作者: 野人e族    时间: 2008-1-27 22:16     标题: 教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 2 j( h3 @/ c- D8 J; r: X! A
   ' k$ y# }& J2 v4 }0 X% `0 S
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: # R! U- l- S# i
   0 s8 e# R+ R& Q% W+ J- D
  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 1 l+ U2 d. H' o* B: a
  
4 U; k9 p1 U. y  Options: " h3 G7 ^( W/ H  ]% v
   / y4 w/ |5 b. v
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 0 g9 Q& T- ]: p' s
  
: M6 K. a) S3 R& h$ q2 ?  不停的ping地方主机,直到你按下Control-C。 ( k9 C$ s, x9 m/ K
   6 f" `! B& F# r# n9 J" J( v8 l
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " o& @$ u9 K2 a7 r4 ~7 k
  
+ _* Z. G& [* @: R! N' S  Q' X  -a Resolve addresses to hostnames.
1 ]: j5 u. y* Z% U4 h+ d   . t# b; L) K0 J! V; R9 ?
  解析计算机NetBios名。
  `5 N7 D; e" A  
5 a9 Q2 I" o- M: s5 R  示例:C:\>ping -a 192.168.1.21
1 a6 U# ^  p6 H$ P: V' E0 b   8 h" x" K$ w  H/ J$ b
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
9 s& C$ Q2 t7 K* D0 j% G9 i6 o   - x9 U  H; C" R9 f+ e3 W
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 f0 N9 |! z# G/ r  
  d( t3 L  v1 h- I  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % ?8 v% e& s6 a2 M$ X) u
   . P/ ~/ L, g9 k9 ]2 n& |$ U# E
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 _/ I$ l' i; `% {9 P

  r1 l; [; m: K' n4 F   ! m& O# }4 Y. y  W# t; a5 h7 {3 p7 v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + Z' g8 K- w, r# Q  Z$ p2 E' W: y
     E# u& C0 o2 j
  Ping statistics for 192.168.1.21: 0 }" z4 p" S: G9 J5 i
  
2 S0 |) |+ Y0 m' ]/ b" X! I; G. r  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ( u4 y# ^2 D4 o% f1 j' E
   ) n  h7 b+ {. X
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 8 n# n- _* L0 q
  
- Q' w5 X3 v- q/ f! g# F  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 5 @5 m: H8 |! ]
  
: H+ S6 G. V6 ?! _0 J6 V  -n count Number of echo requests to send.
! Q- A* I8 S& g1 O$ o0 y" @4 }  
. p6 A6 Q; f% J3 c1 p3 @  发送count指定的Echo数据包数。
) f; H8 N$ k; Q/ A; T   4 a7 y6 {* c; t5 m& ]
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 2 [3 Z9 A$ q9 z7 I" }1 @# Q
   : o1 `, {3 ^0 x: M4 k0 m  [8 l
  C:\>ping -n 50 202.103.96.68 4 w& N* G% c3 a1 o# J! v
  
8 D: Z, B" x* {# ~  Pinging 202.103.96.68 with 32 bytes of data:
! g* z8 g" Y# l& J  
: w% [2 H5 _% j$ k$ Z% F5 ^: \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# U* ?9 K8 z- f; Y* b$ v: |/ j& @   2 O2 O9 ^# A  Z; b; C' d
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. U' Q  a3 M5 b; P( K  S. l8 P   # B/ ~) N% p% M3 v1 C' w: J6 {7 U' m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 i* K- k4 Z: C* V% h6 _$ I& l* L
  
! p- I$ P& a! p# Q5 |) N  Request timed out. 8 D+ s/ z5 T3 @* N
  
- S( _: k6 S' t5 C/ a! b  ………………
/ i2 H+ X1 |2 M! r' ~8 r  P5 G" ?( S' C   . Z# n- @1 x$ n1 g" z% a# t: I
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 H) {, H. w: C+ ?! o/ a   # v. i, R: o! v0 B9 H4 Z, ~( x
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" W7 N' N2 Z! H" @9 B   6 L. R# e- T2 J% E  p6 @& e2 Q% D
  Ping statistics for 202.103.96.68: ( C2 Z1 F1 P1 [
  
( a9 g$ m  q+ H' z7 t  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
# }$ o$ D% q$ A9 d8 n/ F! _  
$ r4 a/ }6 G2 C2 u5 k. `  Minimum = 40ms, Maximum = 51ms, Average = 46ms ! R1 O. |7 c" K9 Z
   . s% e. s8 u& J0 J& ]. |
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
) u+ v  n. k2 p" l  
5 J/ {) B$ l% ^. q2 V2 U1 E" J  -l size Send buffer size. 3 ~4 J! }0 ]* ^" p( O
  
7 v4 T! s7 r- W% |0 g5 c' k  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




欢迎光临 捌玖网络工作室 (http://89w.org/) Powered by Discuz! 7.2