返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。   o3 e2 ]  M* M! t
  
9 i+ d# d- o( d9 |( t/ K) ^1 T& I- o  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
  V' s0 [: f" z5 o3 [7 c  
& J2 |: U9 |- N7 W. E) j! d( f& q  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
* a) p; h' v3 ?, ~8 [- }  
( N) S8 q5 F& ^  Options: 1 Z4 O2 V3 [  b% F3 F8 L% r
   2 n; w; P5 b. e7 A1 A+ }0 M6 D
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
6 \% A, b' ^; B, m9 y8 A1 p9 k% S   2 B, d$ I/ @+ G7 V! b+ t
  不停的ping地方主机,直到你按下Control-C。 3 b. X  n: C( Y. N+ J
   $ R5 h% N7 r; v$ K6 k  B, l4 i# l
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
# s. ?: u& `9 L   . G- I1 f+ o5 v& ?0 f
  -a Resolve addresses to hostnames. % F2 A/ }; x! p; G
   % Y5 f# j. }/ F( k. `  {
  解析计算机NetBios名。
( t( x- Z0 {; D+ Z  a  
; b, w+ }, n* S  X! M  示例:C:\>ping -a 192.168.1.21 . ^" r/ Z  Y+ y& V8 ^: p
  
) ]; C! k0 M1 z' x0 L  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 6 G) e4 ?9 U! a$ Q! E. v. ?2 C+ l
  
% |3 U5 |" t! I. Y6 ~8 d  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& L7 S. w* O# K* a  
1 L; w7 B: @8 R. S  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( i. e4 S' v4 O! D& c( g5 z$ N   5 I" o7 \/ E% C
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" ?3 S  K# Z# I  M
1 P/ `6 s# `& Z( a  
% g# i" D7 M# X) n: ^  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 A7 q) S3 i8 t) F" J4 k   ( {4 I' w9 ?1 V0 p( |6 V
  Ping statistics for 192.168.1.21: 6 r: F3 ]- u. J! X
  
1 d2 Z' E% b. i% [  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
. p3 [6 }% ~4 `  
6 ~- u- }# E- [' ?; P) `  Minimum = 0ms, Maximum = 0ms, Average = 0ms 3 I1 r; l, Z6 H6 s, y' Z" H; S. _
  
& A+ `  T/ w" m. ?! A$ P$ T. p5 |  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 # V, _5 F, W8 b, `8 r
   1 ~9 K9 O0 j# q* R3 I  `: `
  -n count Number of echo requests to send.
3 r, s. |4 T0 c% Z" G) V! a   9 A7 p( e2 V0 K; v( p: B+ C
  发送count指定的Echo数据包数。 / o3 ~' q" q2 R% M4 c6 T! ^- m
   " q2 E% ?3 |: M
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
/ L2 D: u5 A  _  k: w* N0 ^   , K9 J; z$ u0 j4 Z/ V
  C:\>ping -n 50 202.103.96.68
6 l. a' C0 A4 x* p   5 G( l! y! {8 A% f- `
  Pinging 202.103.96.68 with 32 bytes of data:
9 l& z; h; ^5 z1 t8 M% g  
7 J) E2 o$ r9 O' ~% \, x+ y' h' I  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + f0 Q; N1 J9 O7 o. M3 _
  
: H# u& X) }  R6 R/ y# _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 V: G3 R& J  I  Z3 |  
% b. o+ k" A+ j+ y* l  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) C. _8 p/ `- b+ f7 Y
   6 m; J1 d& {7 g* \* a
  Request timed out. * c+ K8 T" S: K6 v
  
4 v( u, x/ a5 ~% {  Z  ………………
7 j" h& N- V) ~; [; ~) K7 n  
" L6 r6 N2 W. n$ |9 @+ w1 ]  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 S  e1 z  K+ K( C1 b  
0 w( J! O4 g. d/ D8 u! X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 N1 t/ A% H4 V( f  
2 X! Z5 Z3 w% n# M! W" S  Ping statistics for 202.103.96.68:
' Z/ Q" q4 q  {/ h3 Y: N6 {0 y# ]   " C) y6 q9 h  `& G# j, U
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
! w) n7 f7 \  y& D5 X" V  
/ f# X; x+ B; O5 y; g  Minimum = 40ms, Maximum = 51ms, Average = 46ms 6 v+ L% V7 r; x7 {1 g7 C
   1 t! J$ t) G7 ?: ^
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % r) g% w$ [+ A  z/ n9 Q
  
- o, ]1 o9 I  E4 t* H) D- w  -l size Send buffer size. " O0 z6 X6 c. [* ~& D
  
) G7 c" ^2 P# w1 t. O0 V" C  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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