返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 % J0 }# }0 x* ]& f, g9 W4 ?; O- `
  
: A1 j3 ^# h" l) Y# d  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 8 u7 a# S, M  W7 q; Q
  
0 d& r1 p" ], f% i/ L3 G  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) k- _% u7 R1 g( [0 D$ j3 u& Y. ?   0 |' G7 L, x& s+ R* Y! g. [
  Options:
( h6 d! _' l" h9 j+ r% S8 B4 o1 l  
" e$ ~, ?$ O9 M% t, j  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - t/ M$ q# `& O+ K
   7 e" M2 M7 A2 z2 u4 S/ s
  不停的ping地方主机,直到你按下Control-C。
1 h6 M4 O1 g( b, T   ' g. |" o2 x6 F  ]& w
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
  a+ t: R$ a) r/ }! V   & g7 R* \1 p% ^9 X9 {+ o6 z* ~
  -a Resolve addresses to hostnames. ' X* e& [0 y! T' s) Y
   8 ?8 ?( \! }/ l* Q2 G0 E* t
  解析计算机NetBios名。 , w6 g5 c. X; t/ L6 A2 _& P# c3 I
  
1 l% l7 \1 h% J: t9 e  示例:C:\>ping -a 192.168.1.21 ; U7 j) o0 B3 m$ G. |: v; [" Q
  
% N! V0 b* M3 J) |' Q0 }  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
) Y" V- I- U8 T+ z1 j7 ]  
2 }# L& L8 o) q8 F2 n  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " Z; P, \/ K  i+ R' [5 x/ v. g
  
( W7 D# n5 T8 _8 P4 i$ h8 J  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ i9 U( l  _6 h/ g; Z* }1 J  
. \' j. U1 t& M  j  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 s3 o: G* P6 C5 T5 K- j6 k; [0 _

! X+ O4 ^) B; ]! `! A. ~  
8 N1 j2 H! b; X+ [1 ^1 m8 p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: ?  M' ]8 L& |% a  
8 j% v5 w6 W- h  Ping statistics for 192.168.1.21: # W# |3 _! l5 A
   9 ^# E2 r3 s; ~
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
4 Y- D, u/ \1 v   ' @, t! R" U/ j' t- K: k  u
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 S: F+ i- A" _" {& x- H# U
  
9 ?3 S' F2 b1 b! B! p) t$ ?& z  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
6 Y; h: F, l' p3 J7 H   6 j$ K0 W; A# q( f7 ]6 T
  -n count Number of echo requests to send. , H+ g( P: l# b+ v7 Z8 a3 X
   7 B5 n1 T! K8 Z
  发送count指定的Echo数据包数。
: K2 T: ]  U5 H0 G   ; G* {" X) f" N5 _' I2 Z6 _
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 6 g* I( }! {7 D# u( ?2 D3 a
  
5 H- v8 k. M& u+ y& e  C:\>ping -n 50 202.103.96.68
9 ~3 }: _: O1 A! i   5 z: @$ ?6 Y8 t. T  N% H
  Pinging 202.103.96.68 with 32 bytes of data: + J1 d* T7 d5 C
  
! N0 k9 e$ u; d& R, H  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ R3 X, q3 b) u9 S) ?
  
5 g2 F7 h/ a! C1 S/ K  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 V( n) d0 ?5 c
   6 L8 N: U! F  R/ ~% o) ^( o
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 l9 i; q9 ^; p9 c
  
& U. R0 V& ^* ^( z1 s4 U  Request timed out. + [* K8 X5 K* v2 g/ O% G0 r0 ~
   " u4 U0 w8 ]8 a7 Z! S" R) a
  ………………
1 w& ?5 u6 e& Z; r* ^. c7 c  
# x* }: r; Q8 a* y, Q+ T. _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  W, L5 n/ W4 Q' Z3 }2 s9 t9 i0 D     D6 y9 y" Z) b4 V- Q0 S0 {/ H. O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' u5 L) O$ P, k' M6 u0 V+ f: y( c! H  
" ]4 z- t* k6 m! P/ M7 m4 h  Ping statistics for 202.103.96.68: * D' R( {0 l; k5 o+ H
  
: G$ [8 F; B+ ^$ U- ]  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ' B# p+ W2 T% O6 ^. e, h- u
   2 _7 R4 A" X% e8 X
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ; w3 a9 a$ _0 @! B. Y  m! i/ o
  
0 u) S, @6 F/ c1 ^/ _4 z9 W8 L  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 + Y2 L+ g: N- }+ a5 K4 g$ \
     Z: e/ Q- h" v& q" O
  -l size Send buffer size. $ C9 w/ g4 W) g
  
6 ^+ b4 X! b: y2 `& k  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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