返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * f3 w0 {# u. ~( U
   6 Y- i) ~  s0 t1 l, r2 z
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
& W: a: n) a: _) M! d+ G1 g  
6 M$ E7 d# d. n. ~  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 . k5 z/ V6 }, _7 i6 ~
  
' z: U/ {( T: u! s% r  Options:
% f$ q2 t# [0 r" c" w+ F- x" p  
: ~* k; ]9 R: S9 d; B: ~  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 3 T+ r$ R0 k# H* k6 T: J
   4 d# j9 @  K  p' x7 c
  不停的ping地方主机,直到你按下Control-C。
9 \9 C3 X! z0 w3 q4 b   ' V3 s% m* V; l6 \/ a& u* T
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 . ?. g' h& [. l) E
  
2 B% @0 b+ @0 T8 U" r" ?  -a Resolve addresses to hostnames. " y. _/ g% F0 h0 `/ E+ y' p' T1 L
   ; f: J/ h% B4 O6 t1 Q. r" V
  解析计算机NetBios名。
0 w* f2 U! m% x   1 k5 w$ U; |* Q1 y" X% F& H! d4 x
  示例:C:\>ping -a 192.168.1.21
+ S# ]/ m9 v3 D- k! Z' }  
+ o' l' O# _, t. W, x9 |4 w$ i  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! ]& V) }- w3 w3 n   , N4 X+ l6 P1 d& \+ P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! o: p% ?: n2 V2 I
   8 c4 Q% D' g; `% X1 J" g
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ i7 }- W7 t# a8 }   / Z7 q/ e7 R/ n4 Y$ ~1 F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( h3 ~1 J5 `! s  I' K3 D

* E* J+ t# U+ h4 p0 z  
+ ?+ f5 f2 y) Y2 y( Z6 g8 t+ p9 R4 _  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ Y: t9 {1 V6 j3 O
  
; Z: ~% P9 r- I9 ^6 l8 t4 j6 Q& N  Ping statistics for 192.168.1.21:
9 A7 n6 ~& j, _0 _( F2 ~  r! J4 D" P  
' L( h- u! S4 }  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 x1 Y) t1 R/ E
   2 Q; l' f* U3 E' l
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ( ^8 P8 r6 x& P! s+ @
   9 v$ `8 p5 \% i: n4 d
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 * F( _+ y* G, I7 d7 C  i
   9 l' C+ R$ m" V" w; Q/ T+ q
  -n count Number of echo requests to send.
$ d' B9 N4 \1 z  
# l$ o8 o0 C- l/ C  发送count指定的Echo数据包数。 & N/ @5 C$ k' f+ l" M, ~% J/ T
  
8 ]1 a; N3 v6 \2 m( m) Y/ V  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
9 Z! n  v- P7 v. i1 E" W5 X   ; h/ o; E( E& D
  C:\>ping -n 50 202.103.96.68
2 i+ f/ {+ w" O, A+ Y7 ?  
. m1 ^) Z( {: I' b  Pinging 202.103.96.68 with 32 bytes of data:
6 W, `/ j( L! s! D  
# j1 d  g2 I4 z* U/ z# T  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 L$ B" M) g0 g9 y& _  
+ C* v8 {" d( D+ \3 w" V! R3 S: ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 O; C1 [( M8 t. ~$ S/ n8 Z7 L" O
  
+ V* F' G* \1 l1 |# h- A, T  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; q9 h4 V1 w4 N2 }: A3 n
  
8 @5 `$ g- S/ S  c% P2 M  Request timed out.
/ ~/ {2 Q  d% ?. `- Z# ~  
) P+ h$ k! c. l  ……………… ( p) Q& }, ?$ O: Z- {: H) {
  
# a6 s4 c7 s( f! v6 j; z8 z: Y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( ~$ x* A5 f, w: B) d* M  
8 k+ B, |! w2 Y- M3 r' C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . T1 _2 j1 ?& ~5 q( {" O
   / c0 I2 a5 C5 I% h0 b8 }
  Ping statistics for 202.103.96.68: . |2 q; n1 I* U* w, [- M" T
  
4 N( L- V4 b0 ]" {/ y: ^: ^3 s  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: # D8 X- o3 h7 Z! N, i9 g
   * C4 `) @" e- M, E" s# X' P0 b7 e
  Minimum = 40ms, Maximum = 51ms, Average = 46ms / s: [2 J) P( i1 v0 A( z
   1 @# p4 m" u4 ]! r9 j0 O" ], |8 ~" d
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 1 _3 v+ n7 k, j- \* Q
  
7 c6 k3 E6 q9 E' x" ]4 z" m# h  -l size Send buffer size.
1 R: ]2 ?3 F8 `   / x8 w! y$ q6 @& q" \
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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