返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
" F  g* l- I# W6 Y7 |# u5 I  
. Z$ ?3 Y, I4 W* D/ o- Q  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
0 E) @' G( v1 ~7 M* x   ' ^: u! n2 T' z8 |* U  A! l+ A; o
  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 & |- J' a3 B) d) w! ~
  
- g2 \% {% O/ p" |- z4 d  Options:
" i) n7 F3 k1 g% [2 M9 j  
, K7 g) u; ?: V' C  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
4 F, x7 n; S/ q- W" _9 W  
9 T& {9 H% _) {$ i7 M  不停的ping地方主机,直到你按下Control-C。
, |2 L2 a) _% m2 S9 w   9 P; i0 l, }, r
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ) O# @- ^: v- ]  w! D! w6 L
  
7 W! P  r  y, x" ?, x  -a Resolve addresses to hostnames.
9 x# {: I/ a2 c. r   % [: S1 w" f% {; \
  解析计算机NetBios名。
. J, H7 T! w: S$ m* b" ?. `1 `  
+ P1 H. j4 v! v: c2 h  示例:C:\>ping -a 192.168.1.21
9 U1 W. ^0 u1 m7 @% F) j" I1 j  
8 f3 V% R# ?" ~4 N* E/ n3 d  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 m' m$ t7 P* H  
' K/ c: a) Z: r  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 f  C$ d8 y0 u0 d# J; `* U9 m( Q  
. `9 @5 }$ p: {0 @! f0 x  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 U0 k- S/ s( G) t
   3 |: Y9 t5 @0 ~- [; Y8 ]
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 I2 X1 E7 H) a% n& Z

# x% ?4 W3 _/ x# w/ d# Q5 S   ' X; H( {$ a$ Q3 q- @% i- [
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ v5 r$ J: ?5 ?   % R. @2 I2 _8 O/ ^1 L- t) _
  Ping statistics for 192.168.1.21:
6 }; X) m+ P/ l5 a2 P1 D5 Z: l   & u. a* {% w" M, Q( U/ y! u: O& S8 @
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
/ P  a2 i0 y: ~6 C+ Y( m   - L5 D, }6 d4 I  t& ~
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
3 \7 y/ k: d6 e" q% n( E  
' m- U( M  R3 j2 l6 `$ u! N" s  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 5 W3 a- W+ J/ ^0 `' f6 }
  
. R/ B1 ]1 m( L7 M' ~) Z8 }  -n count Number of echo requests to send.
' U' M7 X! I5 m& S8 \, F. E   : l4 R* [; Q  C9 N
  发送count指定的Echo数据包数。 + R: s& @+ @( [
  
0 W1 [! t  O( k4 l" _  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
& z- @- h% r+ }/ ?0 `   : h4 J) ]- r5 v( r% h
  C:\>ping -n 50 202.103.96.68
, T/ S8 l2 R3 I/ Q: z* S0 }5 c. V  
& z% O8 X8 s/ o  Pinging 202.103.96.68 with 32 bytes of data:
/ w+ T, z9 T$ @9 b8 Y; ~9 t: {   9 H6 v" g. s# K5 ?% p. u
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 G0 K4 _) E2 W0 b5 Q; r9 m" C   $ E6 {. O4 \$ M# C6 Y; H& h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 ?7 `% \& T( |7 G/ F9 g! p
   ) w7 q! o$ J% _$ X4 s$ V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 p4 c1 T8 S- Z5 |( n   0 W! h2 E  |& I+ B
  Request timed out. . l0 r; O1 N2 J7 ^8 j, k. I: u+ O
  
9 d) v1 u* E' T; v3 d  ……………… / V, ?$ W& ]* d$ }
  
4 G) x/ o8 y+ r! u  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * d8 ?: M+ d* k1 T% H  ]" w0 F
   % Z0 [% O0 z. P" M& J8 n' p- Z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. f4 s2 K$ ^+ Y3 D9 K0 h  
9 b" Z+ A) s4 {  Ping statistics for 202.103.96.68:
  P. O6 a- d7 g# H* F0 s/ F4 Y) X  
! ]) q5 e  k9 P  r/ P  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
* C7 [0 S: L1 X- N) W  
+ e0 I5 E8 t, k  Minimum = 40ms, Maximum = 51ms, Average = 46ms ; m1 y+ O0 y* s
     n. x7 p" h$ O* p1 k# n  Y2 m# z
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
% ~& C0 S8 V7 w; S  
3 g: [8 f4 \9 L  -l size Send buffer size.
: B1 [# M* G: K0 C  T3 r   9 p/ Y( r' u+ v" ]
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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