返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
+ J! T* E/ }! r9 L8 ^* O- N( I  
% Y9 |3 x4 t8 }# l  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ( U/ G1 N, ]) a) l3 `1 r. c# L
   7 A' j$ Y9 W$ Z( [2 V
  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
" x- M4 Y, K, G& i5 l   4 R' K) J" c; E+ ^, M/ x
  Options:
9 f4 s6 j, k. w3 Q9 N   + |0 N+ |- Z" S; G0 a
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
" `. a) x' k/ l% J4 t8 I  
4 g- X# g3 u! n( \4 c( p1 {  不停的ping地方主机,直到你按下Control-C。 : W* q6 Y2 M2 p- h) ~! `. N* n
  
+ Y4 j: L$ v' b% m, u  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ; {1 [, C3 l6 l+ M! n  i4 y
  
0 N( n! M3 T) B( x8 v0 v# O+ }  -a Resolve addresses to hostnames. 9 y5 @. e0 H& |% j
  
( S  g. E! M6 d, O* h  解析计算机NetBios名。
5 v6 h, O. P0 Q5 P4 {2 d: k# I. D+ r  
' G2 H4 {$ X- D! v! m2 Z  示例:C:\>ping -a 192.168.1.21
9 Z  w5 D2 ~/ Y) j  
5 S7 f: {+ G; I1 _4 R* Q/ v) \  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
3 ^# W/ }7 X9 z( [0 o4 z  
0 i9 B+ P$ Z0 i  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 d3 E" K, H, @/ k3 L/ U   1 X1 g& |3 x, W0 x
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 ^% y# q; M1 ^; r8 y
   8 B/ d: e* e0 N4 ^3 R
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + y9 k$ c8 v7 @

9 f2 i4 X6 U0 }2 J   5 @; `. Y0 ~$ |: i8 A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ M; b  M, _4 U) r5 Y
   6 j/ s# K' j) G) x7 x: _% H
  Ping statistics for 192.168.1.21: , r$ b  J1 m) {5 y/ i" Z
   ) R7 L( j3 K2 b) B: r$ X! F$ }
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
! ~; f5 [/ b6 N/ W7 c  y   / h3 u$ s8 ^& C0 }2 G; m8 i
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 E# ^- o) \, e& p9 `3 y
  
0 D+ W& G- \- _$ ^7 A  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
) ?/ p4 N9 m) C  
# g0 ?+ l+ ?- R7 W$ y  -n count Number of echo requests to send.
1 b$ l$ i3 ^4 }# N% `9 z  
1 D' J7 Y' s% ?- ^) t( F/ o  发送count指定的Echo数据包数。
+ n; A( Z. V( A( \% p  
  I" M5 c- s4 Q5 r  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
7 r6 ]% t7 W. E% r   3 l! i5 S$ }5 Z: h7 q4 c
  C:\>ping -n 50 202.103.96.68
# R) Q7 G. Z& p5 z  i+ R1 U& [8 l; E   0 J6 u# f, y0 a: Z; W6 H
  Pinging 202.103.96.68 with 32 bytes of data: : X9 B4 c; S' V: V3 [
   8 q2 O6 b% |! c6 ^! g
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 A& {$ f6 ]  R( @9 Z+ l. [) E   1 q) y+ _1 p' o% }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - O2 X1 c2 g2 ]7 x
  
/ c9 ^$ u/ l( _5 q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % p7 Z3 ^8 J+ o( O0 N$ ?8 W
  
" @$ v, W% `8 U  Request timed out.
/ J! d, u1 |/ ~! q0 E3 r0 {6 b   $ j& N7 M2 W& Y
  ……………… ' }0 c, R8 `# b0 K( g( O
   ( i+ O8 X# X( `- t
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 C, S3 j# e: p' Q1 C+ j   1 x/ T$ U- [1 k$ v/ L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   N6 K3 Q  ]  i  S6 |5 M
   % Z4 X3 l4 a' d( ^1 k
  Ping statistics for 202.103.96.68:
& p. C" E% d7 U5 `) c8 x  
' ^4 |, U- f2 p8 {  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
1 ]5 I0 h" @8 {, `1 b  
" x8 h. a& l% M4 N$ L  Minimum = 40ms, Maximum = 51ms, Average = 46ms 0 {, F, C6 j6 E' `$ a
  
" D- o6 m0 Z; i3 u$ X  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ) ~7 S: L: ^, D' o  X3 M
   $ u* m  E9 C! r* J) [/ g& ?2 X
  -l size Send buffer size. 5 M0 O9 ]* O; ^. \: C# j( q0 L! y
   8 L  s7 H- P& H$ h/ l
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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