返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 + d6 t- V5 O4 J
   ! M9 w) w7 A/ d
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
+ P" L; I# `4 Z, }5 U7 D0 J5 y% e& d5 z  
6 q3 ]3 Z# W9 w/ y$ y6 `  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 . Y4 ?* H1 e  H  Q( ]9 g! ]
   , m# |/ b2 s5 y8 h0 g
  Options: 6 z5 E; B) [. `6 s6 I
  
: Q4 c5 f. Y; C8 V2 C  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( U; P. I, {( V8 }8 k: X/ K9 ~
  
. |+ Z# \* D3 |4 Y  不停的ping地方主机,直到你按下Control-C。
) M/ V9 O2 n  N6 r" d( k6 M4 v, |   2 x2 q; [  s, |* ]1 ~1 p: @
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 # t$ d/ A* y, E: W. V+ \! t
   # {+ w0 R1 R+ e% y9 F+ |
  -a Resolve addresses to hostnames. ) G$ u9 z0 [. R# }" X
   . m, Z7 ]6 g( U8 d8 Q- D- H( m+ l6 T
  解析计算机NetBios名。 6 E) Y) @# V: ^
  
$ R* K# g0 y& s/ k1 N5 N- G/ S  g  示例:C:\>ping -a 192.168.1.21 6 U' n/ t3 |  m( \
   % l) I9 |2 j1 m' |
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 q$ V- p7 [* `6 X* e/ f# f; z; V1 m   * B3 h+ N5 b* w5 N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 @( @/ A# r# u7 Q. {7 U  
8 U( N2 b$ T8 `2 H, V, ^  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' z2 h3 u1 |5 L% @$ }  
  ~% Q0 l$ C# [  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 R: Q% ?0 f7 n( s# r: m! j% @( x7 Q( v/ N7 d4 ~" K% U
   - @- d. J8 D" x
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! W4 O) k4 I* g! `& b, P8 t9 H   ! R" l$ \$ |$ F$ ?
  Ping statistics for 192.168.1.21: : Z2 A# B* z) A+ Y! @6 g
   $ Y' w; ^0 i: `* F* Y" v2 P
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 7 A0 r( X! t8 W0 U$ N
   2 n* s- }+ `$ X, }+ Y& s, u
  Minimum = 0ms, Maximum = 0ms, Average = 0ms $ _8 l* M4 K' K0 g: W* n1 X
  
5 I0 e# ]  R+ }2 z& j0 P  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 8 s% [+ A. P7 ?6 D
   2 n* |7 S7 S; R+ Y
  -n count Number of echo requests to send. 2 k7 @3 H% o6 u5 L+ w! o0 k& ^
   + r4 F" B  w4 s3 C( s$ _* {% [' G# f
  发送count指定的Echo数据包数。 * R2 C# ]$ F" G3 f6 w# R; g, h
   8 S$ b$ f% T: Y9 u+ O" {
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
" c% K( @. @1 L* i" w  
5 r5 Y4 J' H4 G) {  i  C:\>ping -n 50 202.103.96.68 % h* `5 W+ F' D+ y* h, ~
  
8 D4 u) b' d3 A9 H( Y7 \  Pinging 202.103.96.68 with 32 bytes of data: % {- ]) D8 d: x4 a7 g
   & M, t) y  M0 d8 [7 |  m6 B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % J, U# b8 C: \% O: v; t$ W+ _
  
2 Z* b* V' \, ]3 v* Y2 c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & a5 E+ ^8 S) Q3 U
  
$ U. }8 t+ Y3 z+ J  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * {* U& l& t: n, B. n/ G5 T
  
) a5 [5 h, C8 d( K' b  Request timed out.
9 n: B  E. F7 V/ Z. B% o# n  ?' ]  
& e1 U0 z; l1 M9 o$ m  ………………
- J, {$ q: h6 v0 t% N   0 J3 S- K% k$ _7 d% x! ]) T4 B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ [; u7 m1 g6 @/ z   2 Q. a3 s" D: a& i
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 W" B2 G' a: X5 g( B1 S
  
! p8 u  s* a, f- `; j  Ping statistics for 202.103.96.68:
2 O4 Q* P; m; p* ~  
7 F9 c0 F6 U1 i' b9 M  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: - _; \+ _* ?" n6 B! e  a; \
  
% n1 H" b& R1 ^+ [1 c! f  Minimum = 40ms, Maximum = 51ms, Average = 46ms ! o5 h- v- h8 S5 j! T
   - I( g1 j1 w- K; x6 g" w8 [
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。   `, X: k' L  Q4 V2 T
   1 v6 \6 m/ M6 b& t0 _, D& S: U
  -l size Send buffer size.
' @9 _6 e$ u- N  
! J7 F6 `8 e+ @! |1 p# y( q) g  D2 Z  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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