返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
% _( X, ~4 ]1 n" m  
1 ?0 B3 I0 X4 r% }7 J: j$ F  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
5 r) X! W3 ?* z: D2 O# Y   3 y- Z' o/ C' D: k4 c0 r
  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 - p" N8 `1 f* d
   & c+ e: [6 T/ z- C9 m# E" y- o
  Options:
3 k& S% Q2 k) y# r" Z# @   # [/ {+ D% e2 Z5 S4 r+ ]6 a
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 E" I5 u  K0 w. {
  
' X0 x9 D+ X& P" m  不停的ping地方主机,直到你按下Control-C。 ) Z* V/ U1 ?! T  y, v
   2 J1 d* V6 \  B: V
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 # H( h5 _! \( \9 g( d
  
2 k- I  k5 @3 P! D, [5 h0 `% u+ J  -a Resolve addresses to hostnames. % g& p" c: _* \9 Q5 x; z7 @/ y
  
. ?8 \6 @( N3 ?! a' D7 M  解析计算机NetBios名。
4 o) f# W+ x6 e8 }  
4 J$ I. d: Y: Y% U  示例:C:\>ping -a 192.168.1.21 6 [4 h2 {& |" v
  
& G# N* C4 B: h1 n; u! H  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 4 k, t. O- j3 o" l* f2 [* O
   ' O8 t6 @2 a/ M/ [7 W& l7 u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% f, K( ~) t9 n# |$ c  
- Q& D- U( L' j6 O/ @6 @  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + p* \7 [8 R! `+ |# A7 M( f
   / h6 W1 S1 {- |
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! A( R  B; z8 K7 K1 I: E7 U1 g* l4 u* m2 ^) i0 Q; C: |. u
  
1 |0 F' f6 M! k+ h  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " z7 ]- w/ H! E( W+ V( I; Q: n
   : a6 P( B3 i$ c  @
  Ping statistics for 192.168.1.21:
: x, u  I# _' X& R0 z) }   ! {* E7 r2 |" {  Y
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 J% [4 H+ w( m7 P( x+ `  
3 n9 t  L& ]% z* V$ W3 J  Minimum = 0ms, Maximum = 0ms, Average = 0ms # O, Q, N! V0 q( d/ b
  
) |& j) s. A" O  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
3 {) g" ?9 m5 @" p  
9 X5 q- Z- \8 o: p# G' I+ R# ^  -n count Number of echo requests to send.
5 C# f' }2 D, M" F   " t! ?; u8 Y+ }$ h& w
  发送count指定的Echo数据包数。
. e5 B3 o( `& u2 z, w  
. }5 ?+ ^; |( [8 k& X+ \  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ( m* y# d0 C7 G/ o0 E
   2 q) p' i2 V+ g( |/ a0 t' o
  C:\>ping -n 50 202.103.96.68 2 ?* t8 R! E- d; ^3 t, _/ Q, s7 S2 b( W
   # t- {; t. Y- @: e, R
  Pinging 202.103.96.68 with 32 bytes of data:
  L; H7 S7 H& w+ [   1 D( _+ S5 q& A1 Z4 G
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 W% \/ q2 Z1 }) w+ g. x   ' j7 O+ C" G2 _4 e4 N9 D# Y1 K
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % P% E, ~1 c. J4 N4 x
   : y; m- I* D: v# s0 \
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 _2 K8 K1 i8 K2 D* t' U
  
: W$ n; O0 c2 v: c- [* W- S! l  Request timed out.
# k( x/ l6 X5 @5 ?" N+ K   9 v4 M$ s$ n% o: f
  ……………… - c7 r6 F! X# z8 B3 e; p
  
+ c. T) r# k# v  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 t( n( G$ R7 u, z+ l! b
  
0 `2 k( ~* x' ~. E, z9 |+ u8 b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 {+ j  _  E$ ^2 c0 p+ u1 I6 C
  
; m+ M5 l" d7 p: W3 b( d  Ping statistics for 202.103.96.68:
  V9 ]+ u4 f" G3 z$ r! U; X   - v, M+ ^+ i! X7 m7 b; v$ ~' c
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 0 n- v. _# m% i
   4 L) W- g+ t( _( f
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 6 G, S; y) X* ~/ `: e, x2 r
   8 @& P' U# w. A# h- E
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
0 M$ V1 k6 _/ ]5 P* S( x  
( z4 \. l0 x. i% A1 i* o0 Z1 t  -l size Send buffer size. / u- B( H$ p% F( U# [+ f
   4 V" z- ~# X. P  q# x
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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