返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 0 }* S1 w  y7 D: F$ }
   : Z9 w9 i* f) {0 ]2 |
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: : ~3 c2 V/ f9 z9 C; z( Z
   . @% Z6 U* F  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
( ?5 J  T) ]  \' h     F( {9 b& D- U: {1 q, a
  Options: 9 R+ M2 e% r8 z3 x9 K0 m
  
+ F- k. h( A2 D: S: l; k' W  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
$ B# l. ^$ w+ V3 i  
! G/ }; [2 L; f+ {  不停的ping地方主机,直到你按下Control-C。
& g" z3 H2 _4 @/ i6 G/ A5 F  
0 M; M. r6 _; w  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
4 h- s: q" A/ L& o0 X( _  
4 y+ L) u( Q: H' n( C4 v  -a Resolve addresses to hostnames. 1 Q8 V) ?$ t6 K% Q! z# m# o$ J
   7 w( z: d2 m4 x; u* k; i
  解析计算机NetBios名。 0 J( U* {' p* }+ r0 B
   9 X. z- {3 c' P9 T0 p6 D
  示例:C:\>ping -a 192.168.1.21
3 `$ w! K7 f. S; B   # Y/ t8 @/ W1 e7 B: N- a
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
" x' Y' q) j* X- W+ q  A  
7 l6 |, k, x% k* O7 v* Z2 l0 \0 j  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & b: i( h- a) B  h5 U0 c2 e8 h
   ' s3 p3 p. p$ ~
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! ~+ Y& Q* J- }6 |
   , U- i3 M: _( w
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) N! X2 g4 M) g& U
3 ^- i+ l+ a5 z
   " R0 q: {1 w( O
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  I+ U( `, G, h! g" @' T   ( M4 d! {! R  Y5 F, z# k/ A$ V
  Ping statistics for 192.168.1.21:
9 q- H: C# x( C9 ^- O  
6 I( b) Z; |# J: k; p1 x  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: % X/ f9 v: \9 i4 b8 @0 U
   5 {+ Z# v5 o* S: T3 n8 s
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
% r+ ]6 P2 S, p$ Q   ! @, A4 P# ~) Q- _! O
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
3 o- s* F/ x' C! S0 ]3 `  
& x  t$ I1 \  F3 H4 z2 |  -n count Number of echo requests to send.
8 d% P% L3 ?9 `. c) ~. F   : z' K' K! Z, k
  发送count指定的Echo数据包数。
3 o: k% U6 a) |' W  
# |' y3 X$ I& l6 U9 M* k/ C  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
7 X7 b# Y' ~/ \! P  
- U# ^0 P" U9 O, @. {  C:\>ping -n 50 202.103.96.68
8 P/ ?# J' D4 @+ W; v- a- ]+ m  
( R% o* c) ~3 m$ \  Pinging 202.103.96.68 with 32 bytes of data:
+ ]/ K* G! A' O$ r' l: Y8 V  
" ]% E0 b" R+ [( b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + Y. l$ }" z8 [( e: _2 L8 |7 j, A
  
' R0 n. X5 w! i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# R8 l( g5 v1 @6 M, U  
+ Q: q6 K- l& _  s. b2 E) g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: \$ u5 X2 ?$ c! X   - U+ m) k# Q4 o9 ^0 Y
  Request timed out.
! E  ]! b  T8 W  A3 [4 G  
  M- e6 W& j8 s7 h4 C- r  ………………
8 p1 M0 G$ W. Y/ u: U+ _   ' H; L( i7 K, M# R5 H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' U0 T1 q7 _5 Y" ]
  
% R" P5 \0 u# {/ x( x  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * l) N4 `. G4 A. E* X. O
  
" f0 ~' T, |1 l% B) H6 j3 S3 E  Ping statistics for 202.103.96.68:
4 ?, s+ q) D/ G  
, i) i- U* A) X% R) t- t: v  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
/ r6 G- x; U/ r   , |! c0 a9 [4 S* I  q
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ( z) G# a. C7 Q4 J3 r# v
   6 h+ {( L3 Y/ M8 k, g' T
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
" q( ?& y; b" n  Y' u% Z   $ K9 `, f7 }: ?7 |' o+ @+ x
  -l size Send buffer size. . }  k! l0 u. b4 ~
  
. P3 \0 r6 B1 m: `) ^  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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