返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
0 i/ H6 {  d! `; ^  
6 I1 i! i* x1 G5 E8 f! c  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
7 d4 X8 g, C: w3 i! h   1 W- J' F: W: s/ v4 @2 U
  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 6 g9 V) [% [' ]! ?( ^2 ~
  
3 [7 Z" f' U; a, Z# h  a. ~  Options: 6 V, ?7 l) c2 P9 L1 I, u
  
/ z3 r% Y/ `# {( ^% _  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
6 E" o6 c% k' g9 y  
; O' k5 `; k7 a1 M1 a9 e/ R7 o& I  不停的ping地方主机,直到你按下Control-C。
1 f" y  q4 {3 C+ L! c, {  
7 R' B$ T' Q1 |; Q; o8 i" a  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
+ o5 E( t. y8 z" n7 ~. `* @   / C6 E' K+ q. H! A7 O- J( J5 `9 N
  -a Resolve addresses to hostnames. : S+ z3 b5 n6 ]9 y9 C* X" P
   ! T3 O4 j' L6 w# q* U
  解析计算机NetBios名。
6 H2 d5 S- y8 e6 _$ N8 M2 u  y8 |  
" |3 C5 X5 x# t: G1 r) {% m5 R  示例:C:\>ping -a 192.168.1.21 ! ~+ {$ }! E. I/ j8 D9 f4 Q% g
   2 b/ I* _  g  q: f/ ~
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
( W* v% n. R. V$ k   2 F# \9 M* W2 l& H5 J% [
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) A+ u# Y% \- c/ N( N  
+ O$ I- r+ T8 C5 X/ R% s  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 W: y3 Q, Y# H$ }. N, F+ q
  
& m8 s# y& S- u' ?. O! o, O  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ \) {& S' }) D, _, g. K! u, |- @) e$ ~2 L8 [7 m4 R# t, A
  
* ]) H9 v: ~. @  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# K: ?3 Y5 j$ B  h- t  
4 J. d2 d- d. l  Ping statistics for 192.168.1.21:
, o8 Y. C+ o) y+ P; j% A/ Z# v   ( L/ z8 f! }2 r5 _( t; n7 C( d+ H
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
7 }7 _% s1 M9 \4 e     T; w; q+ L3 H
  Minimum = 0ms, Maximum = 0ms, Average = 0ms   e! |- v5 s$ t* f" }
  
# O  x: N8 t6 g# q  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 I, l0 o( w/ ~& y; q7 o
  
9 s/ Z( E+ g# {1 U  -n count Number of echo requests to send.
9 l4 A2 v/ M7 S. z  
9 q0 v9 q4 K8 ^* f  发送count指定的Echo数据包数。
7 n. Q) L; c7 i  
. i+ `: h# ^) Z/ G  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: $ `5 F  x; f) s! V3 h+ q/ |
   / t7 N. }" M6 i
  C:\>ping -n 50 202.103.96.68 " p- Z) {. N! s. z9 @! o! N% c
   & S  V: r3 C, l
  Pinging 202.103.96.68 with 32 bytes of data: " i# r1 W& i3 ^+ ?: ?7 t& L
   $ W* G% S, j: t' t+ G
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - l: V7 M8 p6 v& l5 L
   : _0 y& \: M/ i
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 ]& x5 [* p3 d. P9 c# P
   6 e# @2 v! v3 M+ F5 m1 m( }  K
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 z8 M4 ]& l' G8 t9 ]. ~
  
+ l; M/ S5 @- F# r0 `$ Z  Request timed out.
; D  z4 w6 v& c   . m+ j6 a8 c7 v# |
  ……………… ' P( q. v; B! b' A; t, G0 V- N
  
+ d" X$ [# i) _  {& P  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- [" ?4 c$ w0 q   - `& \, p* ~6 g6 [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + h" w/ i5 v) Q2 ?& d" c  q
  
8 H( P+ ]% n' Z6 E" o# m3 `# D  Ping statistics for 202.103.96.68:
' Q5 @3 G* X/ [; ]0 `  
3 U: w: C7 ~1 h) u5 R- n0 l. s  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 6 b$ t5 d- Z) ?% e9 k3 L( b; W
   " X% @7 `7 f& Q
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
0 T( x( s% J% H0 a% ?  
! \! |1 U; e9 _# z* a% {8 b  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
7 |) d$ C, |$ g5 l: {" V   % [) F3 r1 e9 Y4 q* _3 g" g
  -l size Send buffer size. 1 m: I- c+ d. m7 F3 o
   # w  ~0 _) j  N  `
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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