返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 7 G) n' o4 S, d2 e; K& }  E1 f
   : Q  O% p0 e& Z% L3 [$ {
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ( I$ i3 }2 u$ c# n! P$ V
   1 H# G/ I6 U7 i6 R: a: @& P$ E
  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
  l. o+ a3 ]8 P) m7 u3 s4 e   - @: v% P6 w  F$ _6 _
  Options: + e8 C( e) z6 a6 h; }2 `
   2 I' u4 w6 Z+ a; V" k
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
+ x3 N! |2 k# o9 [% O   8 a( R( F( p. Z! T4 X
  不停的ping地方主机,直到你按下Control-C。 9 o' e( @: ~. t1 T, B- m
  
4 y1 d5 P3 `) o8 \; e  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 z. Y+ x+ ^5 O" O- q
   , U4 e( a$ o: ~& v/ D' Q! g3 M
  -a Resolve addresses to hostnames. 0 [5 ~2 I% u6 u, w7 n
  
  u8 R' `: c: @5 W' P  解析计算机NetBios名。
0 b$ `, j& i$ ~0 k   6 [7 @( Z3 I( R
  示例:C:\>ping -a 192.168.1.21
' Z) [; v6 e: Z% C% [  
; U, H( Z% _+ a4 t* s* n& @  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 4 c6 ~; K, r& {; p* }
  
" `* A6 B9 H, @9 m% t: D  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ G% W7 a5 W( `5 i" t' t$ d9 b/ `
   6 K" e1 ?8 ^! Q" k9 D
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; P! {8 _* h& r
  
" q  q: I2 N% m: X) p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 y: L; @+ R- m  R
' s  T, @9 b% ?, x: {   7 P" I- k8 ?3 }
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * p; q* V/ k& l. {$ ~) C
  
2 M3 J  Q4 M2 x/ }1 ?4 {! D  Ping statistics for 192.168.1.21: ( K) C. P: t3 o
  
" Z$ k! u  s! S8 f+ S9 J7 q  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
1 H" g9 \/ S! s: z$ q, L$ t/ x1 a  
) v/ X" q# k% \/ ~2 k; h  Minimum = 0ms, Maximum = 0ms, Average = 0ms
! G. d! s4 p+ [2 |. G2 C  
$ m5 e2 ]6 j3 O% _  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ; F( Z/ M: S9 `1 L7 n7 C
  
7 u- M, i# F6 s' J  -n count Number of echo requests to send. 0 ^/ B$ C" _& ]9 H0 [0 u
   , r) g, S2 R, T0 U& v7 ^8 B
  发送count指定的Echo数据包数。
0 s$ N9 F# Y# e4 k, E# ~  a  
0 R( x6 S+ y  L0 ^6 x+ ~  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 2 Y2 [: [! a' ~4 B# A! K3 L
  
/ p3 d  ~9 [: s* {  C:\>ping -n 50 202.103.96.68 ( _: u$ X) O* U# z9 @
  
* O$ Z5 s2 Y  N( }( M% S  Pinging 202.103.96.68 with 32 bytes of data:
# H+ D7 I6 v, b# {# E  
, F" j! x$ p% d$ z, W" L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 d7 {, v9 r7 @$ \4 u3 X" e
     v( G3 d" @" N" p
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 r/ X. S- |2 u- p( e* a* C   : i: O1 l+ ]7 n* D+ R/ i
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* X* ?' L# W8 [) }) n+ M/ {  
$ {& U" c4 {8 w6 _  Request timed out.
8 }8 K# L& i& S+ o  
$ j: g3 P( |8 Q/ ?2 o/ h/ o$ Y  ………………
+ P5 }! r* _; V: G   8 T% B5 j1 u, o+ F
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! u" P9 S& x# K( P2 W. u* m, H   ! ^8 H2 `# Z: Y) G7 n: q7 R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: b1 X, {& |- {0 W. J! H# E  
* r4 X* I$ _0 b$ l+ ]$ P* g+ A  Ping statistics for 202.103.96.68:
" R9 w/ ~* S" ?8 ]. T# R   ( \1 Q) U" Z4 l% r6 T; F- I8 {1 G
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
. g* H$ q" f2 U% z$ H9 h0 n# u   & A+ _1 A$ d8 E# p. y* c4 x7 v% U2 l2 [
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ' e$ A6 b; S- p1 f
  
- a! i2 s# I6 j/ l* W4 W* m. k. r- B  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 2 `* z6 M/ D8 V4 M5 z  z
  
3 _; i8 y2 u" o8 t  d  -l size Send buffer size.
# _6 `) R7 E3 ]! k0 M. t   % z3 p, `# l7 s7 E7 n6 i6 [- A
  定义echo数据包大小。
89w.org捌玖网络

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