返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 , h+ D8 y7 A8 d  I  Q
  
: i3 Z& _) i! z4 I" u0 w  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: / I& E  P5 x) h3 K" U% V( J
   1 {4 g6 f+ ?% n' 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
* J$ j+ B$ }  ]1 i   $ v, B* O* {: m9 K$ h9 O7 n
  Options:
9 Z9 u, v$ p& }* |4 W- K  
+ ^, W9 p) c2 {0 m0 K  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
+ M& O$ \+ c# |  
# F. B. H) W4 j& K! P' S( W  不停的ping地方主机,直到你按下Control-C。
4 d3 ?" E" k" T/ a# R; g- H  
( B1 ~3 f" `+ D3 |  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
/ S7 ], F( Q+ V% {& V  
9 f+ @4 v, L! U  -a Resolve addresses to hostnames. , ^8 E3 }! o# @) @
  
" [- o/ B/ T3 ?, b  t/ u+ K0 s% l3 ^  解析计算机NetBios名。
, X4 n4 R9 l; w7 i! i! F   ! g1 J$ E  Q/ d( K! @) k
  示例:C:\>ping -a 192.168.1.21
- P( _; K  o" O& L9 n0 P+ X   ) w4 I& H  _4 o$ W( S
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ) v! Z7 [. t: S2 |
  
: @* R" Y/ f1 S9 o  a  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 o( q+ |" `# w" P2 i   + {# n! L1 S) C) ^1 j3 z* z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! D1 O1 G4 g7 X# J! E  
9 P( e, M/ J2 y3 W% h4 m2 e5 T7 ]  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * i0 G" u1 U8 b. X# q/ l
3 p; H4 e) i# m; Y
  
9 n- g) T* j! _0 r. C* F7 Q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# `7 M) I, u8 X! w8 d- P  X   ) d& L* @0 i3 [( D1 ^4 W
  Ping statistics for 192.168.1.21: , k  c1 M0 U  m, c% `: _( O$ W
  
. ~2 @& }1 b4 k0 S' L% _1 ]  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 7 {5 a$ r$ h  T+ ?  t& W" D
   7 @' f. H* }% m, E9 {& @8 X
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
! |6 T9 a/ P* u# F) E% U) [( P  
$ k. s3 s+ Z& v( t! T  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
& g* H) y1 {5 x6 O   * y0 ]- \. l: X7 ^
  -n count Number of echo requests to send.
; w: n7 \; o4 h' s5 ?; G: g  
9 g8 V1 g3 Y- ]  发送count指定的Echo数据包数。 3 ]$ {. e, Y+ L: E8 P% l" Y8 t
   . Y# O! K) A, k9 U. _
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ! X  N0 ^. d8 M2 A5 e
  
8 L' O5 a  R- C  C:\>ping -n 50 202.103.96.68 0 G6 k; L6 e, l: v. G- W$ i3 U
  
; e9 Y" l: f& z6 z  Pinging 202.103.96.68 with 32 bytes of data: - T' y8 D( Q5 A3 c2 _6 d. g
   ; e; O# R1 s" I) q1 N1 Z& f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 e+ }4 z4 K7 A6 V) s   $ t. o& b1 ~" Z+ X5 Y: b6 ~; v  d
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' J% z7 K: P$ O. M3 _8 s$ O' }   ) [  [8 J9 b; b, S+ [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & o& u0 B2 E$ O/ C. C2 ~
  
! _# Y1 A  b  N  Request timed out. # O7 z# U5 D' U
   0 Q) V* O4 U# S. {  Z( N
  ………………
1 Q' B5 i" ^9 H1 \6 `   ) s- D& m5 I. r2 Q4 s+ k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 R2 i$ t) \4 j" L; r4 s& j  
% \7 _( d1 u9 v# y7 Z0 m% a  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( w; L6 g1 A5 c, g
  
( }: u, v- i. Z  Ping statistics for 202.103.96.68: 7 w" c2 z$ X4 O' D% U5 I
   2 a% S, G; R* X* k  K. n  f" J* y
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: , n. n- F) b' R
  
5 \. Y8 ?+ R% u5 j  Minimum = 40ms, Maximum = 51ms, Average = 46ms
$ i; p, P8 g5 m4 |2 z  
, G0 w6 }2 w0 P- i) g( k( _' i  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 4 }" a" g& r9 }, \* H3 _& I
   % b: r6 U) n2 Q+ c$ z8 w$ [1 y5 H
  -l size Send buffer size. ' _. k" d' G4 F; E
  
% b# c' R2 G8 u! q* B# B  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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