返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 # z) Q3 k1 o. j4 P' B8 P/ `
   % K3 d+ M! ]( [
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
6 }) K& q. G* H# S2 U9 N   % d' \! e$ _0 a% z9 Y/ I6 d, }0 I0 h" Q7 I
  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
1 I, M% \+ A8 H! `( {  
4 T+ c$ w, g) D& }6 h% d  Options:
& T( `, i- [6 G6 f4 D. g   + Y5 m& m7 m5 _% R2 G
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! V( n& ^' R1 _. }& C) ]1 {+ F. _; l
   & _) D9 w2 Z2 ]1 M" Z
  不停的ping地方主机,直到你按下Control-C。 1 V$ v1 X# |) M, r& u
   ; e7 A6 x& G0 [/ D: s5 v" s4 Q2 e
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
' R; N" h* J8 @4 p" M$ |* I& Z7 B  
8 M+ Z5 u/ E3 ^0 o: Z9 U$ d  -a Resolve addresses to hostnames. 0 Q" b: {( h0 r
   - K% E) B+ o. t4 j. ]8 R/ [
  解析计算机NetBios名。
! K3 J$ u3 s# T  
" L+ E8 ]( D; }2 ~7 D. f  示例:C:\>ping -a 192.168.1.21
/ q! r0 A8 V. @- h$ d) h% q* F  
* A8 y, B$ y: P, _5 V, r  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: & B; d( t! c# m( r" B8 \" B
   6 G0 N% A# n. c; C* {9 o) ]
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 L" o& z3 z( ?# L' x1 ?5 x  
; w6 X4 z) x% T7 [" U+ T- ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; w, J; y# B! k0 V7 a2 E7 v: }7 w
   & w( ?  N! e/ z7 c" Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) K1 C) `$ H' W8 m
8 r3 S6 G. p3 i0 e   0 \1 H, a$ I- M, h& f8 h! B
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ u; N8 q- z. c! j  
5 E7 F! R9 y8 f$ @' |  p& Y  Ping statistics for 192.168.1.21: ; b2 G) o3 Y1 S$ a4 Q% n1 q
  
! U4 F" G8 U: O/ F$ |  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 7 E9 U) H  n2 B
  
# ?5 V0 x, d7 M( E/ |+ {  Minimum = 0ms, Maximum = 0ms, Average = 0ms 0 S: Z: d: V% G. p% C
  
, I/ M5 i6 u% k( J' U# I  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 2 J/ A2 a8 D" x  C3 P* r
   5 h% @: f) G8 U0 s3 G: k, J9 Q
  -n count Number of echo requests to send.
0 m: i0 n7 l3 v7 H" @# s  
6 }2 m% K/ \3 S5 c# A  发送count指定的Echo数据包数。 ) a! {+ A; M5 a3 ^7 z# s% G% ~
   % n+ J2 V  c8 Q# \6 Z9 N/ n
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 0 t: {7 a, l" j" k5 x6 I1 L8 K
   / k- E5 T3 K& n& \1 r
  C:\>ping -n 50 202.103.96.68
9 n( v9 k9 T( w  t  z# W& J$ M   / K2 O3 U! `& E. {) @; x
  Pinging 202.103.96.68 with 32 bytes of data:
9 `( Z* U- B" A, q( f  
( w2 o' |" K3 v. p+ ^  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ R1 C* N  c. Y8 c& m) p   ( ^/ [  \1 \; y/ _8 ]% B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 I1 K- A, X) b8 a: I- G/ a( ~
  
( D! W2 l. [8 X6 {3 r, o  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 D3 i9 L1 {0 I0 T: ]  E
   % o* y) U5 S9 u4 f
  Request timed out. 4 D! o, V7 o8 [% s4 b
   6 C0 i/ S2 ]4 r* W" o
  ………………
4 V' G+ H8 a' D* d5 o! x   3 M5 m! v& z* q" c/ o8 X" D) ^
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ X. X, e/ O- }  
% }7 u5 I6 G5 C+ K0 G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 u' ?1 |: J" I- N7 m* t  [2 R! {$ M  
2 I- D, x# p- Q0 p$ j  Ping statistics for 202.103.96.68: 3 x. ~0 Z$ A, Z
  
: T0 k4 ?. E9 J  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
6 P* b: ^- v: ?: ]% r   $ i9 ]9 c* Y, ^. }& D0 h
  Minimum = 40ms, Maximum = 51ms, Average = 46ms $ F4 ]4 |) m2 }' t/ K" K: W. |$ @6 U
   . q/ E' `+ S. U- y7 ?
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 / k9 r6 _4 e! U! y0 ~( W
   9 B( c9 r! D5 u) i% W6 G4 Q
  -l size Send buffer size. # d" h1 [' G( [8 [8 v4 `7 V
  
* o# q% ^6 [8 I5 m% M( n  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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