返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 9 |: d* n8 ~' o* z
   6 a5 [2 R: n/ ^% F0 o' Z; k1 T8 {
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
* m  I* a' c, _2 z1 [: ?  
) l, o4 t5 @+ f! D7 K* o0 o/ B  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
5 B; Y- n* G9 t8 @1 h  
( f* q& a% Y5 W& B5 D9 _& h  Options: 4 S8 G% s4 P( c' B
   ' a: ]/ j7 @' K+ k
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. % m% q( o: }) ]" U* S
  
! W) Y5 n0 n/ O' o* N  不停的ping地方主机,直到你按下Control-C。
& J/ c: \$ m& b5 g% v   - b8 W# d* D' {) C
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
# g5 x5 Y' d5 x$ j! g; N) s+ V   4 H% s1 P& g6 V7 g4 ^
  -a Resolve addresses to hostnames.
  \0 I; q* ?( A# G  
, c; l" W, ^6 K: u' D5 |  解析计算机NetBios名。 2 i: V0 t4 G) c; Q
   ) q+ p9 O7 T3 C+ ?7 Q+ }0 {
  示例:C:\>ping -a 192.168.1.21 & u5 `7 s+ R- D8 D# _  ?0 J
  
8 P6 @9 H9 H7 J3 z6 K  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- U8 t6 L% r# E; A8 I* ]8 U  
' m" O1 Y8 J4 ^- F' @  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' a! [! a( h! i9 }7 S2 J* T- [& @! f  
) j5 b' ]; i; C( i5 j$ @/ P5 i  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % Z+ Y/ j3 ~( }0 m
  
4 d) x$ |/ a: a' T3 G5 q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ Y2 B% m' `, x+ |3 T1 j. t4 z2 E4 [
   : p0 z+ ~7 Y" P/ T% M
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ f; ^0 T+ t  |" E# B  C  
6 c$ V' s# T! E9 S' J  Ping statistics for 192.168.1.21: , f/ l$ d  Y" r/ G: z- n
   5 S2 `- ]- n8 ~' n5 H; j% ?
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:   {  m. @* m, @4 g
  
: B9 L( G* }) {8 q6 j  Minimum = 0ms, Maximum = 0ms, Average = 0ms
) E8 @5 U/ `: A: y: J; }& L  
# ^' ]3 h6 B$ K* z7 R8 T& c  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
: ?; N4 N% \, o, n   , ]( {0 ^# G; ]) @0 |
  -n count Number of echo requests to send. : S4 ]$ W6 h: f7 L3 b1 a! i
  
2 M( u- K1 b& s- s" b1 g; j7 @2 n- m  发送count指定的Echo数据包数。
- H" N+ v) I3 E7 m2 W! `3 ^0 ~   6 ]! @, G% y4 ]  O; K( I# _7 k- l
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
( x2 q7 a4 Z+ f- t  
& g# g) N* Z# K9 z' S; D: k: _0 Q  C:\>ping -n 50 202.103.96.68
5 f7 K5 e3 N8 B" {1 t; {. y* k& r  
% q* e+ h1 _5 }/ f  Pinging 202.103.96.68 with 32 bytes of data:
5 W! k# K9 W& Q  P: @0 \   6 r' l" Y! G; E+ E) r$ g+ ]
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; n$ I. |! R% q7 F6 [/ r3 ]! ~  
5 H' e& S/ X! X* g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 s& g9 s+ V1 x* _& B- L% K  
6 i7 j6 n9 P8 i, A0 r: @' W7 D  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 [. l) i. c3 W- k, K" l
  
: N: P# F( e0 U/ n" x5 l! s  Request timed out. 4 N! J0 i1 [: h1 r4 S
  
; ~" v- J. e6 @  ………………
  O# e& U1 k- {2 O' `; \  
1 u! Z+ y; c; a$ H$ q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ t; K; Q) e+ k/ E9 V" w
  
4 w& M5 [" }* F* s, E  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # i& K* C# x7 m' p
  
' ^$ t! p3 O4 r6 \  \6 E  Ping statistics for 202.103.96.68:
1 R/ f/ D3 C, p& e0 y- |' _, ^- G  
! @, Z6 b' n, h/ m* }9 U( Y$ I  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 0 D7 V( Q( }9 K" Y6 b- v
  
* K5 k  {" {. g0 w4 w/ f  Minimum = 40ms, Maximum = 51ms, Average = 46ms 4 f1 F' r3 G7 t# o0 B
  
* p: x/ f" D& |4 H5 @! q8 q  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 / L/ d/ Y% z2 i+ [9 b
   + c  K% t  C0 E" V& ]1 W# z- k) Q
  -l size Send buffer size.
% @. e6 ?. S, c0 p$ J9 O+ [6 E   % F9 c  q. z* |/ |, G  o
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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