返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
4 d# W' n: o  g* t4 d( }  
. K! f. @& {1 g8 k* I3 x- y7 j' n7 q  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
8 ]; }1 w6 {( ]7 c   - B% d; u2 i+ v; h& W) S
  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 0 a$ a# t3 U9 }
   - p4 A, `! v1 p4 A- X/ t# m+ K4 t: l
  Options:
+ e2 B! `4 Y$ R5 P- v   - G6 @4 `( E! ?9 L! k. Z
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
) x, T( n# I$ `9 T1 L: j- S; \7 s  
( q& q# Q" `+ y0 p& @  不停的ping地方主机,直到你按下Control-C。 3 h6 }% {  o0 |. k4 C2 L
   % Z) r# H# q& C
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 U0 O5 b& {% d4 `
   2 O+ ?( N# J- j* {6 P
  -a Resolve addresses to hostnames.
& O! t& k5 o& S3 ~5 B  
) x$ V. S2 _( z/ E; G; d9 T  解析计算机NetBios名。
  W: H! r3 y8 V$ V  
8 t# G9 o+ }! I4 d  示例:C:\>ping -a 192.168.1.21 , }, ?' P. X6 `; U  \+ o$ z
  
! S/ `8 a5 x& \& Q6 V6 K7 L  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: " q: @. O* Z1 u
  
5 [+ x2 [+ k. g; z* O5 ~  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" h, x% D( J1 j& H( q  
( S  n( y/ H$ ^8 i- h6 K9 ]' f( _. ^  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - C+ S8 G1 g4 X6 B
  
0 W( A( P9 L' |  R6 T5 ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + P! p1 a! G5 ?' M4 ?
/ M" j  k+ }; \# Y
  
5 z2 X& `* Y! s: @( e. p, _! m$ m  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % G% {  N  D' p/ D" C/ Y
   5 Z7 G" Z" v( I4 ^$ j; W& N
  Ping statistics for 192.168.1.21: ( [' i' F/ p7 H. d# R: t
  
, L0 E# d6 \( T- q% I: {& S  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 W0 l) |1 ]' N$ m
   ! _% C& Q" c  O) P7 O( ^0 f
  Minimum = 0ms, Maximum = 0ms, Average = 0ms / x8 o2 Y* A# ^
   ' d1 Q% H9 I  o' e$ j) ], J
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 1 N, m: @  B- P8 w
   6 y) E8 a4 ^" J. P2 g
  -n count Number of echo requests to send.
. j' Q/ b" Y) ?: e, Y; V  
8 v$ v1 E' W4 j$ A* U7 \/ S% |  发送count指定的Echo数据包数。 1 W, |  [4 y1 S7 [5 T
  
# [" k% C" g! A  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
( R% j7 I% Y! P. z/ L5 G4 p   - }% [. ~; x% c9 _* i
  C:\>ping -n 50 202.103.96.68 0 t" ?- T; |: I7 l
  
3 A8 O! x3 o7 w* ]5 Z( S+ n: ?  Pinging 202.103.96.68 with 32 bytes of data:
4 R: t7 E) m* l4 v; T: b. f! E  
( v  ~, f& _) U9 L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; a. O- c" L1 l9 y/ u0 B8 ~& g, U' O   & H" ?! d% H% v, j1 W0 V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( F7 Z% k/ `* {' }8 S8 M
   $ |# ?' d) a9 }: A  b2 _
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ I; p1 z- x& j   " w/ l4 F! @& o% Z3 T
  Request timed out.
- h" i4 B5 C5 n; F& z0 i- l  
5 B2 f4 i3 K7 w' L& A. K  ………………   U) B4 {% j2 h
   2 T$ `" h. \: x) M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + c/ R2 g9 w, x! a$ s, m, }) O
  
6 O0 P: P. l9 ]  e) h1 V  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: w7 I; t: x) l. {7 C' G  s: t" t6 L   ) f# i) u5 h0 g: r* Y
  Ping statistics for 202.103.96.68:
' P: s3 \2 \6 f8 a5 y; X. B5 p1 D   - |# Q8 P6 y  K2 ]  V2 K& V1 J
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
3 ^1 W9 D6 G: S2 p5 ?  
& M5 Z, g! ?0 r  m  @  Minimum = 40ms, Maximum = 51ms, Average = 46ms
- b" f: v' ]$ B0 _5 ~4 d; \  
3 ]6 I* n1 k' [0 r4 b  m; v  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
: u. m. G4 Q+ {( W  y. {' ]! U% l  
( v- s( P( x: i' x' j6 |+ }! e% ~  -l size Send buffer size.
# l  B3 G, n5 F6 {$ o  
* p  `2 ?& H; ~- B6 }, Z- P& g  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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