返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 + G" e) ~8 M' X! D" \
  
8 j" z# c/ M9 x1 I; F/ {  n0 S  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
6 ~% }# f5 k! Z' ]4 w5 l! M  
( z6 W# ?. G$ u" B) x7 O/ r  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
  D! m, S& q$ z  
; R& D. Y8 e+ u  Options:
, n( C$ `" O4 R1 n/ p  d  
7 W! Q6 M0 g/ B  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
! a0 O/ ~* ?" R; y, P: g7 ]   2 z% J% V# H% s! l8 K: N# @+ t8 a6 _
  不停的ping地方主机,直到你按下Control-C。
( W( t( w9 m7 [2 Y. a# R% ^- _   2 u* k* S7 Q& l
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
- u+ c0 B; h0 ?' z! v) U  
1 q, U/ ]# J2 i6 r  -a Resolve addresses to hostnames.
8 }. H, f. X* t  _# K  
0 c- v. _/ i* ]! r" W  _; S( o  解析计算机NetBios名。 1 J6 B2 ^+ w) K" p5 ?, L0 ~) U9 S
  
. Y5 i+ t8 K) _/ q6 v7 f  示例:C:\>ping -a 192.168.1.21 4 q& g( Y$ r$ ^, O2 H
   7 H$ y! A1 i# r% X1 x5 ^& n( f# H
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
  h" b+ E' I6 v7 Z6 q   6 w* p8 k  s1 H; f" `/ I) q* e/ V
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 i2 t8 A, Q/ [! p3 n6 f( n  
  J  m& T9 o' C( c, ?. v% V: |$ o  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 K, s' o2 _0 I7 Q  ?  
" c8 t+ |8 D  {$ C8 m* J( Y& ~  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & i6 m9 n* n: n3 g4 G+ M
) I/ x. T" @7 c) v
  
( X# H7 h! e7 {# w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : d) B0 s6 d8 F2 k! g
   " M$ x! V. A& V2 `  G% l* Y, l" W# x
  Ping statistics for 192.168.1.21: 4 w% X  h; m4 b7 D/ f4 O) e! t
   ' P" O7 e& Y* b2 y: h# u
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: " y1 G! k. y7 m
   $ `5 m. b6 G9 j5 l( [  J' K
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
* W" S' }  V6 p5 R4 i( [9 |2 c   1 g, D! {/ `3 n. u5 T
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 , u% I7 x$ _4 C9 m7 Y
   4 l5 h/ X" N% O% N# Z$ k1 b' C
  -n count Number of echo requests to send. 8 K" P/ P9 l% u' u$ l! O
   1 ?' k, X9 Q0 T' d( _3 V
  发送count指定的Echo数据包数。
- }. o, s0 {+ b0 e   * w2 q( L6 R* q- @: w
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
4 E, V0 v3 {; }) w  
4 v! P9 y- K1 m1 M' ^$ }  C:\>ping -n 50 202.103.96.68
. @1 l9 _8 b  O  
. k+ \! x$ T* ~1 p' _0 d0 l; u  Pinging 202.103.96.68 with 32 bytes of data:
, m. q# y- E* h" U0 @   7 b) F; L7 g( a5 E' j  e. ^0 e+ ~! M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' f# R# I: w. o5 W
  
! {! j+ l" p* Y9 w4 ~  W  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; w, }/ a# e' L1 w/ C3 Q" m! F   1 w$ m9 ]5 i2 c$ I
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ w; a( [# i. s( E   # J- d2 u  \0 B9 b7 O) f
  Request timed out.
1 U$ f0 M: @' i! i% {- t  
, S: ?3 v+ L5 V. p" {. ~  ………………
# x" D# t2 l( }# i( u  
4 I6 T5 ^! X5 y8 a$ s: r+ w' y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' B+ S1 _4 g; u; v   % b3 {$ z! p2 h* s& {% M% W/ h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " O) h9 Z. ?9 t/ Q" S/ D0 N" M
  
) n# I1 u2 ]3 S' k: ^7 e  Ping statistics for 202.103.96.68: ; @3 T* U/ D5 f9 W
   4 B! v+ I( N2 Z( `; s6 q( y6 D$ L( |
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
: U+ [# S' X$ b1 q  
* j0 P' B! j4 u2 d) n  Minimum = 40ms, Maximum = 51ms, Average = 46ms
8 u8 q* l2 ]7 R' O9 [" M( t   ; q, C: l; \5 R* \( T& ]5 y1 g
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ' ^+ Z# ~8 e1 v9 P3 O- _2 s
  
+ \$ c. z* p! u1 O# H# q3 ?  -l size Send buffer size. ) Y2 t0 b+ r, @6 x- c
   9 B/ k& F( L6 ~8 S
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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