返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 $ `9 ?* c9 o9 w& o5 X1 u
   . N% h8 `5 u& V6 g
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 4 _5 K7 v* a4 o) }( e0 `* ]) T
   4 x* q& L3 F7 d1 X
  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! m/ b; N' S# u8 P+ f: T/ o
   & V" M( y& j1 H8 {3 t. m& D2 Q+ l
  Options: - U5 p: O9 M7 E( i+ |; W' \6 v* c
   " U6 l, F) S/ J! f: [0 |5 I
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
) {& p: l# o# [% y* `! g   ' G$ N0 }. E9 Q, J% P( j0 n
  不停的ping地方主机,直到你按下Control-C。
/ A3 f; N. ?! g5 n$ H. F, {3 @   ! c: X, E: E4 G& ]/ a4 F6 `8 _
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
! L  Z; b% E* G) h1 I   # [" K- S1 z: A' A
  -a Resolve addresses to hostnames.
3 V% B% A- |5 h9 f  U  
. i$ A8 Q- b2 W* {3 C% t( @1 Z  解析计算机NetBios名。 3 P9 r- K5 s5 H& X1 P$ q
   ! B8 A* c$ c$ A- Z+ F
  示例:C:\>ping -a 192.168.1.21 ) q4 X. z; V: S1 l" [8 |
  
, z( W/ s; N; K. }3 S2 ~/ y# ~- w  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: " @* D9 w/ d) w9 X! k
   + m& I$ Q5 z' }" U2 x0 i' ~0 T* W
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# X& }( e. |' X* @/ }  
8 ^3 k# E; }( a  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , G# n1 f* g) M8 n* h) t" i* e3 Z
  
+ j# r( j1 L2 k* l0 ^- r$ V  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 X$ g& I# M- v
7 O% t, S8 W& B3 y1 M- M" e
  
# n- a/ ]: q; L5 y6 N5 b  L/ v) g  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# m& ^1 B/ Q% V0 D, J  
# z" @' [0 C. M, z  Ping statistics for 192.168.1.21: 8 {8 d# s7 `5 \: w: L
   ( k( j5 P" }8 l  g" v; q# r0 a! s# z
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
8 m- V* |+ m* E  z8 |2 B' u, _  
; a5 y( N9 [# z% B! O  Minimum = 0ms, Maximum = 0ms, Average = 0ms
8 w. |& f! A2 Q   , U' b* z8 A: K2 P
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ( P- I- z. s' L
   ! d2 |* Q; ^0 W# x% l
  -n count Number of echo requests to send. ; i/ N5 P2 u# G) A: }) ]
  
6 a- N# V  |# }, G% K  发送count指定的Echo数据包数。 # R( g: A9 X6 X9 ^+ }
  
% \4 V9 K) {5 c1 o0 }6 y  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
7 E/ r$ Q: }" K* m, _6 G   . G. k! d3 N0 s( f4 f0 h1 }& _
  C:\>ping -n 50 202.103.96.68
) h8 }" E0 ?0 f! Y  
9 n1 K: I+ K" T& D  Pinging 202.103.96.68 with 32 bytes of data: " {9 e* ^2 y0 }( l4 D3 P
  
( b& D5 J0 A# Q- }' S  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ n$ K( U. N$ h9 o! k! V   0 N3 T  `$ P$ r+ \1 }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) y* q( m# v5 a! E1 y! [. M
  
: ~' C/ s$ C3 q* s/ s( s: |  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 x! e  V# H, ^
   0 c4 K/ J  M2 m3 y, m8 D
  Request timed out.
1 W  P2 j4 e  W% Z' J   ; i3 L& d9 S; g1 o
  ………………
* r& s* Y/ q# U9 f   8 k+ O; G# `$ Y3 s
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & E/ W2 O7 F/ w4 u/ x" s
   * q3 V# n/ S8 z6 }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 N$ v" L, v3 W0 o, x
  
4 ]% O! J8 n+ b  Ping statistics for 202.103.96.68: ; M/ @: M, |1 v) a. ?
  
" z1 j8 n6 I! w3 l$ c3 L2 q  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
& Q0 H2 K, i( E, w+ Y  
' e9 d+ z* e) }  Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 ~+ Y% {3 }( v1 J& ?9 z, [7 n
  
2 f8 I% k+ ^6 c7 v* H  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
: }+ N& R. a: }4 f   * T1 n) D% m% Z. M( P8 P
  -l size Send buffer size. " n' y/ j) G/ y/ J8 l! x3 B0 |
   8 ^3 b# \! r) b& f5 _; |8 [6 I
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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