返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 0 D8 ]( c: S* p9 L; K% a
   ) V; B* ~: r* }0 w9 p$ T6 |) B0 `3 d$ n
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
& \3 d; O6 Z0 d# [. W3 h3 p0 l   ; o; k6 ~* M7 s! J% ~+ V- d+ V
  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 ' D0 g# E! l5 V7 G
  
, k, q$ r/ G  I. f( j5 W3 Z7 _, n  Options:
# l2 \2 N) r, s$ h* D, K& a0 R   5 A7 t1 e8 e9 Y; O8 }0 i, v
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
3 O6 p/ k. J1 G7 {4 N, E  
: P$ k# q+ ]! }$ B' p+ E" _  不停的ping地方主机,直到你按下Control-C。 " c* e6 B& v# f3 Z
  
  T7 r! E( h/ ^6 w2 J; @4 X  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 + X# u! k# a; u- J: X* m
  
7 P7 Z$ O$ M( v' y& _$ }  -a Resolve addresses to hostnames.
% L( e7 o/ A. ?9 V% M4 Q   + p5 m& o: U$ N# @2 O2 V
  解析计算机NetBios名。
$ Z" r0 K; ~9 u/ a/ [   3 U/ n3 l- c- I
  示例:C:\>ping -a 192.168.1.21 % t9 o$ R( d* s* `8 f" v0 B
  
; @( \9 i% D, y6 p& T( m/ j8 p  S8 A  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 5 h$ W/ j5 s* @9 R$ t
  
- O! b% `. K  v$ `$ x# Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 h/ ~% G5 w2 M) W5 P5 O* K7 i
   6 _" K' c* I" C5 D0 f
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% ]% S9 k+ c8 {/ ]  
" U( p% M9 h7 l: I% T/ c  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 L- a$ v& S1 e

: j; M& V" V" Z4 T. c& f! b   ! b9 x! f2 B) ]# A9 Z0 B' j+ y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, e6 [6 ?. s. f% [   0 O: M/ k% @" O7 l& s( I- m  o' n1 x& \
  Ping statistics for 192.168.1.21:
* K: M8 b; a% w  
6 ?( x) q9 Y0 X% v) a  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
* u7 F7 U( u! N   ( X, r/ B* n1 _
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
4 l, p6 B; ]5 w7 i5 I  
1 t, ~. o5 w  J9 P( F4 ^1 J4 v( z  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
/ Z2 h3 h8 \* A4 n# G* R+ m   / X4 S0 A- I) h' `' N
  -n count Number of echo requests to send. 3 j" v0 X6 S) S, |
  
: h% X4 @" W6 Q  发送count指定的Echo数据包数。 8 K( f' R5 q7 J* |
   0 @2 Z7 p$ ]: K2 i3 A! c5 n: T
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: . n5 K) J" C9 X7 ~
  
' w! c& n+ Q! _* \  C:\>ping -n 50 202.103.96.68 2 Z6 O7 f0 G% P( s/ ?, ^" K1 {1 D$ x' O
  
- W# E/ A. _( ~' D8 u+ w) J  Pinging 202.103.96.68 with 32 bytes of data:
- I' w; O: T) j% B* `   8 [( X! }4 E7 h2 n9 z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 i- F' A$ s* k0 n' d# W- f
   6 u' v+ v0 }  R4 o$ F! Z: Q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' i' C# D6 T6 U4 [   / c9 S7 |% l$ y% u3 |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. K" }+ X( s, s   8 G* x: ^0 t, r3 X
  Request timed out. # v8 d1 R( r+ h  |9 d& X
   0 v- S: ?7 L. R
  ………………
9 Z7 ?% o2 u9 g  
7 i5 [- E6 g/ l  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 y0 W1 A9 \! J6 [   9 E2 a* Y* A2 t5 J' _$ f  i
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; R9 ]! [, \9 A; {& M& }   4 o) {6 G* T8 y; v* O
  Ping statistics for 202.103.96.68:
1 j1 q9 r; q- c2 e$ v1 x. P  
; ]* Z" R  h6 T+ T# K( L  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ! o( I$ a' r+ v! y* G8 l
   % l- h3 c6 J  N8 |' y
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
/ o0 D% D6 x* s: S; f  
& @6 n/ o% v8 W  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 e1 N" g; ^+ Q$ {
  
- Q) J# ], G  X5 Q* e8 @  -l size Send buffer size.
( e( A0 y) m: w+ S, C9 J  
- M' ?- h/ Z) l# D  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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