返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
" A1 z0 g' k+ d2 N; B  
! E+ L4 y1 f3 _; F  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: % H9 e  @6 Q, o8 T( b. u4 H9 R
   + C4 y4 {* V! P
  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 " Y7 t2 `) a/ I* A
   3 s4 I2 y  G2 _2 K' r' f- Q
  Options:
$ j& K# }+ Y  Q2 }* C8 ]3 q6 }   & N9 p$ D4 k) f  L* F
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
; b- p7 V! F2 K# Y  
: F" Y1 A: u% Z  不停的ping地方主机,直到你按下Control-C。
5 D4 P4 @- F" G3 i) a( ?% X( ^) L   7 e, L' f6 \# D6 y2 \. S* C
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
# b. T3 T/ G* B% g0 ~% V   : l/ ^" N7 {' E8 p
  -a Resolve addresses to hostnames.
7 i# ~, h! K! {: Y/ y, G  
9 V* e$ z# N* D# u; G# Q* T  解析计算机NetBios名。
9 k4 R" N: }. n  
) G' J/ O7 q# F' P! i4 G  示例:C:\>ping -a 192.168.1.21
- O% l3 ]( ~4 U0 w) l   * a) l8 t2 [4 I: x7 c
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
$ I% P9 y8 r8 j! F6 S  
3 m4 \0 p: }* M& U+ k0 Y; K  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # B' i% @! `/ s9 V* y7 r$ M- J
   % ?/ z2 G1 X# S
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : c; K% W% y7 s. e& n
  
. j6 s+ q: s; _: x" g/ F  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 d: H  F9 k. a" j* o" n: _% y2 b; d
+ S9 S- z8 B. G& @( ]* D- M+ f  
3 s8 H7 _8 u8 A' t: ^  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 ~6 s: X# ]; w% Y   - o0 O% U$ o4 A6 W0 M' q! i! U1 ~
  Ping statistics for 192.168.1.21:
1 h2 _  n: D9 F* Z+ N  
# [' |% p5 d) h* g  z/ H  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
/ e* F; d# f5 O; R  
0 I! i: b* `; b( H0 V# G  Minimum = 0ms, Maximum = 0ms, Average = 0ms
! Q$ v. s: J, u' ]& s, F  w: Y  D2 k0 _   8 D3 I8 C0 e0 ]4 e! a
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
3 G, N  P: n( x6 a) C+ l( J   * S* D' `  M/ A  g5 n/ j
  -n count Number of echo requests to send. 1 G+ E7 Q( g1 w% c7 H7 c6 v4 b! W
   $ R( G6 z4 q6 m. w0 _* `, N/ ~$ \5 V
  发送count指定的Echo数据包数。 ) k( b5 i% L# D& R: p/ f* Z8 |
  
* |7 N/ ]7 [; Q6 N  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
' Y& ^! Q, T: O4 W   / q; D1 @! @- t4 B
  C:\>ping -n 50 202.103.96.68 : Y! c# g0 m" S" t- B
  
& L5 z) b; k+ m+ V" s( }  Pinging 202.103.96.68 with 32 bytes of data:
; C/ H" U# u* z6 P   % D5 E+ ^" p. X- l# H" ]; e7 V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 L+ n! c  Y$ p, w, G7 Y4 s6 u   ' N+ A3 L, ~1 Y: d
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 I& v+ G  a  M$ O+ N' s3 N  
% }" a, c- X- w1 I3 w* I  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) j! K2 {0 F& [% C& E. o7 ^7 C  
% M" E2 A: Y6 F- S% V; ^$ y9 B  Request timed out. ( |1 Z6 v8 g# t0 e2 }# g
  
. e, p6 q* o2 j" i  ………………   V% ^9 b: y( l8 Z/ C
   1 `# l5 ~6 ~) p2 ~; Q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 M$ j3 d4 K2 b+ F9 t5 Q   0 A7 @& h0 i1 g9 w! n+ D; _
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; l3 t% O6 V9 Q8 v" O: `, T
  
# f) W+ L3 T( R5 `; k  Ping statistics for 202.103.96.68: . X; u' e: d! Y& f
  
- R+ Q* l( [& ~# {  B  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
- H+ e% S6 n0 F! S. N( z   , _& h2 u6 h- q0 Q
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
/ k" ^* B) |% b& U. o5 o   3 j$ f7 W% S! @7 e( m
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 1 L- A! H6 ~7 P0 e5 H0 t2 p
   6 N+ H- `8 r$ e  B+ `; v2 @
  -l size Send buffer size. * T9 w4 Q5 b- P5 J6 B
  
: L* ]6 f! a4 Y% y+ o  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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