返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
' R7 U5 ]9 U8 \& S: K1 B   ) [: J1 {. M3 _7 W! P: j
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 6 t$ x! P: v7 q2 M. W
   / y3 N4 n& s: l9 A# `' W3 @
  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
& z) u+ T8 C% Y! `  
4 t7 j$ f- U  I  Options:
( Z* D. e: Y& {& X  
. @; ^, \/ z" H' l  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! _# x. R4 \0 v& ]2 ~" a0 Z, k
   3 F9 Y+ e9 n1 k! V$ C+ B4 Z
  不停的ping地方主机,直到你按下Control-C。
# y) \! B, O5 D: r9 l0 A- p& D  
, j6 Y" v6 \9 O8 M  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 # }; `. f+ {8 n0 j
   ( H7 }3 u2 y. I5 F& y$ M( j
  -a Resolve addresses to hostnames.   @- P5 O! P* V/ t4 J  \. T
  
& |$ X: p! }& Z- n0 r5 S  解析计算机NetBios名。 ' n+ K0 k1 h6 Q; u* C# G
  
' z9 H( E8 X5 ^  i0 h; n  示例:C:\>ping -a 192.168.1.21 ( _+ H9 J) A  G$ s; l  q! a' v9 D% L
   $ o# D# X0 c8 y8 u$ h3 Q4 w- V
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: $ ~) h, g0 D: ]- x6 z
  
  R2 k& U  r: i* r9 N4 J" d/ C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 B+ n- l+ ]; y
  
7 K% s& f4 B' `$ V! d% M" p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 L& k" k) I; J8 B! S% Y; X   0 C& y. R4 e! A2 K$ N( y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' D3 I. Z2 c& d' n2 w
! _$ Z# m; F: x+ T
   $ T/ _) N' J+ I3 R
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 \6 e! Z3 a$ W2 L/ ~0 G  
0 z" P2 {# c' r. D* X; \  Ping statistics for 192.168.1.21:
4 S# h) g' Y5 \1 U   4 i4 q( v0 P: C; H! ]: l% X: \* k
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ; p  |9 m' M" E5 L( i
  
6 J: j6 y5 _8 b, j- ~, `  Minimum = 0ms, Maximum = 0ms, Average = 0ms
' L/ z2 [# c" \4 E' R; N   " I' D2 l: C4 @
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
( h0 H& k7 i* j' ~) N5 b# M& N% X   - K( N* z. L, v; B% a
  -n count Number of echo requests to send.
2 J: G" L- P- X   0 k. K7 }/ G1 D" P9 H2 e0 n
  发送count指定的Echo数据包数。
2 M. a  e* ?4 S$ d5 d) D; g  
, j7 L9 s  Z: B9 `4 I  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: / z7 Z: ?; [, G' D" A
  
8 O  K0 ]4 s4 E$ L2 s7 U. U/ F1 |  C:\>ping -n 50 202.103.96.68
5 H8 I! v; g+ [; V& J2 _: U# O3 t  
/ R( c8 G  R, k" y- p, I  Pinging 202.103.96.68 with 32 bytes of data: 3 I$ p8 [$ \; g* S
  
  }5 c6 F8 A& M$ R8 ?9 L/ I  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; {( ^5 a; }  k  
& U/ Z. z+ P+ {# ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' B  s% u4 Y. H3 H$ a
   4 P( a1 }) ?+ h9 z5 ?& }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . U3 ?% t! Q4 J( k
   ; C; W  _5 c" ^0 B" Z( X
  Request timed out.
9 _% h9 }3 l  i1 ]   * O! a8 g+ C" l+ W) x# G' x
  ……………… , O' E* s$ C2 m- V2 W6 J* a
   2 v, V) X- C) ^$ Y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 o& g+ [( g8 y  c! E% N( d
   / a  B  \1 g1 k2 o  J
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& ~- E% n4 k' p+ a1 x* ?   + [; |+ @9 ?" _4 i# G* S  Z- L/ \
  Ping statistics for 202.103.96.68:
2 n. E0 l" n! b: t) S1 i   9 }' o; E7 a0 r1 t" G: ^: z) I. m
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
) F! l. ^% e1 ^9 z: d  
. `/ G9 v; P) D  Minimum = 40ms, Maximum = 51ms, Average = 46ms & O9 `) ?7 R5 b* ^1 I7 O
  
( B" l5 `% F/ {* L% ]. l) x  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 * i. Z9 A. W) w# n, X
  
( {( Q$ d4 r% L4 U4 B- {  y  -l size Send buffer size. ) @' A) J; P' H+ n
  
" m( x" N- {2 \+ C3 ~% `9 Q2 g  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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