返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
5 n7 Y' v( r: e/ I* E7 Z* `  h   & b9 y$ `8 i# _7 N7 ?( [
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ' i$ c) V' i2 e/ G( a; y$ z9 B
   % a* T! \, S3 Y
  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
6 h5 }/ z, ]/ t5 w3 N4 i  X  I  
  c' u" I& [6 p% s7 t  Options:
' o8 z( ?$ N, i3 A6 O# C  
# \4 o8 E0 j' [( t/ t: E3 a! D8 b  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
, S6 {1 H" w( q$ g4 ]+ T, A! J0 J     N7 C4 ^$ \2 z: R, j
  不停的ping地方主机,直到你按下Control-C。
5 A6 ^9 x3 c# J6 }4 o! W+ {   6 q# m  H3 {* @
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 & Q) o1 t% ^: `1 H+ M3 H
  
9 `" M  y$ b3 W/ Y3 N) l  -a Resolve addresses to hostnames. ) W+ n4 p$ O+ m
  
! v) _* P/ \2 S1 ?$ u. R  解析计算机NetBios名。
% |2 m0 s& k' ^$ H1 e  
/ ?, g7 r5 T# S' {# P  示例:C:\>ping -a 192.168.1.21 " O7 \7 V: M' f5 y, n2 L
  
" M" f' Q  m& g4 r1 U# F" P  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
9 s/ n3 ]( b! s4 ^% G- L   : b  W0 v9 w& G
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # e% y! c3 P  P% o- i
  
2 e! J0 M8 |1 J! t  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 P5 S) d! h7 `6 m- I* U   3 ]2 C# ?4 |% _/ R
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 e9 u$ R- p3 B4 e" T

9 K! P9 Y8 S& L, V: Z  l6 ^   , a0 j; a6 e2 [1 m* S2 J5 y' d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! r. R9 }2 R6 T" G9 j0 c* R
  
4 A$ e$ K! C4 y9 u, b0 H( j  Ping statistics for 192.168.1.21:
: ?: c2 P$ D2 c. X0 O# p  
# Y' \7 Q) k* h. j% s6 g& t  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 0 ]9 D! c6 W# n
   3 x+ o5 V8 R1 L3 q( Q
  Minimum = 0ms, Maximum = 0ms, Average = 0ms $ ^/ W+ d% y  ^$ N* O0 |5 g" Z
  
0 Y# U8 U' f1 ^; m  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 6 B, `* ]- I& n# O* u
   # k& O8 ~: |" G- {  B, N4 \
  -n count Number of echo requests to send.
9 w+ B' m0 ~0 E, @# Q9 A3 B. Y  
# [+ r& k/ @' Z2 g2 y  发送count指定的Echo数据包数。 : F1 t( a  Q* u' G1 t  O
   & s$ k$ D+ ?5 h8 U$ ^$ n
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
3 a  l4 v6 z& }) [9 i. h  
' X% y* K% T2 @: G  C:\>ping -n 50 202.103.96.68 8 Z) ]4 O" i- ~4 x7 o
  
% M2 ^# X' D4 @) a% O8 v: o% F  Pinging 202.103.96.68 with 32 bytes of data: & [1 v1 X9 Y% O: n8 _# y! W* v+ P" p
  
! y1 z. a" M1 y4 Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) ~8 X' |# K! V( j5 G$ q; ~   ( `8 u: p7 z" f& L9 m6 ]/ B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( q. I( p' F% E1 |1 V% p% s9 h5 G   , I) [( U! V" U4 F# G- j$ @0 O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 L) b) m6 I' E% Q" e( P# u, }  
  d8 G# P: @( Q* x1 G+ n! R/ [  Request timed out.
( E- o8 N, l, _0 O1 H* O& m( Z/ \   * r  N, m) J/ {2 ~7 V- L1 P  j7 h
  ………………
5 w" `+ h& t, ]  
, Q6 T8 S& Y* Q  ^  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 T  [3 e- `4 |- u. K1 F
  
2 H, {+ h, l( p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- ?$ d3 [3 l" j: _- w$ }: L  
0 B- H" q! \6 O. |! T# e3 l( \  Ping statistics for 202.103.96.68:
# Q+ C; h# w3 A2 w' b  
: i+ o$ X, K6 ~9 V/ X$ N6 o  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
8 |, v0 o) q/ ]/ y   * }9 x. w. g1 U# B) |3 H2 C
  Minimum = 40ms, Maximum = 51ms, Average = 46ms : u) F/ g- I! f0 u) v3 `; c9 G
  
. r) z, g' i6 _% n1 K4 ~" W1 G  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 F9 H2 i* ?& K' f) V* I7 Z
   9 H" ?! E  e4 Y. Z" H
  -l size Send buffer size.
: c" x( A& y( Y8 d  
, U, C* t3 \- M  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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