返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 8 ^8 u; w4 C2 X* }, A! e8 V
   , R" Y3 ~8 A$ _' p+ {
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: / X3 b/ z+ J% v/ }4 E
   1 _- I4 W' y+ _( I  j
  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 - S+ }. S% F* b7 E2 {
   ! @+ O) ?# z3 M( U6 ]- m* ~7 N
  Options: 8 z2 n" }- b2 z  N
  
  |! R) U4 W+ e# c6 K  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
: T8 }: e' C: z; f5 r' Y: P  
! r) H) D1 b& A2 B3 T3 ~6 C, \  不停的ping地方主机,直到你按下Control-C。
+ o: X+ A. o8 W% G9 c   + o+ a- D* E" B# F0 [6 q+ @
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 z2 f! ^3 g" ~# B
  
, W. ?" ?. S9 Y3 @" T5 h( A& q  -a Resolve addresses to hostnames. % X( r; d' {) L; I! ?; z0 A3 i+ ]
  
0 K+ D/ |. c8 R  解析计算机NetBios名。 / N2 A8 g# [/ I2 K
   1 G/ j- B% \9 {
  示例:C:\>ping -a 192.168.1.21
9 q& B' t9 m5 A; O( P8 V   ' s9 [1 {8 V% _
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- {0 M. `9 ^3 |5 F3 V( b( q' j   * u: V! q5 a& b3 H& d* w- z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + n, G/ W$ @3 L/ `( m
   + T. _% ?, Q3 X' E+ I8 [( n
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 ?, n" z$ P& P& Y2 P. O7 e   & \- `; ]) W# T$ J0 @- L4 n% W+ W
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* I& |. \, n" Q) ^+ e, p; ~# ]0 d6 P" k5 V2 ]
  
6 V* i. r% {! v' t  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) G" d9 f- M4 _5 i7 c' O
  
5 i) X$ N$ u! @3 r0 ?9 {, U  @  Ping statistics for 192.168.1.21: 4 D" C5 q: q) g3 |, k+ G
   , Q. v4 `  m8 c4 E
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
' x; `6 ]% P6 q4 \3 |7 A4 w( S% L   0 j$ }6 m/ t7 A- N3 {* ^8 }3 |
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
$ G# i- Q- y' u7 c+ t+ N3 i( p; W  
5 o2 c! E* g5 N" ~9 h. f) M  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
/ s# x' f" V+ l- ?! i" _4 z  \5 F- D   5 C4 z% ~  `% C2 L
  -n count Number of echo requests to send. 5 Z# F( O; Z) ~! D) u6 U( m8 u
   1 D4 T1 @6 `6 }& C+ }# n2 ]7 S) \
  发送count指定的Echo数据包数。
; T5 |! |+ k; q! l+ @1 L  
. Z( f% g' X( t* `8 b5 ^. f  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: * m% P' M# }0 o& t4 F
  
! C( [/ V. T1 l" T4 I  C:\>ping -n 50 202.103.96.68 0 a- j$ m. @$ D, G
   ) v, _: b! X( h
  Pinging 202.103.96.68 with 32 bytes of data: 3 H5 h: i$ ~( u* g( x2 B
   6 N% x7 O  u3 L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# _: @7 V4 @0 \( j  
' b' a! k% D% M) z0 S  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) h8 J4 l3 P# D5 W& P0 x/ [' y4 d' v
  
, n, i6 W3 S/ P! x8 N" }% S" {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : C  D. |4 ~7 R6 g& J0 D7 ?1 N/ H
  
8 V% r6 C( `, a  Request timed out.
0 m6 r- d- I, s   9 j; g2 b, h) Q# t& }# a$ [
  ……………… : Y& b7 M1 U) C% |5 [% ?) ]# ?4 X2 X5 X
  
+ _1 A& R& v+ \! \* ^* a  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  W7 x) Y3 Y. A; y  
' k2 d- |1 k# u% U8 u) u- v/ a  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 f( ]9 a" m& R- g0 M  
+ j6 S: R! V$ f8 G3 h  Ping statistics for 202.103.96.68: ! r9 I* Z7 ]0 V8 K! P9 }% \- k5 D& n
   + f6 v" q* X( _7 N7 l
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: & [* U; M4 |& q' J+ F0 ^" A
   / f2 {& w: R& k4 x) x9 b
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
0 a  r/ C8 O8 P6 F0 E1 I; s/ q  
6 J# _) E# ~7 n  E, U6 ~6 r  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % i5 @: O! f* u* k
   4 B0 ~4 J  r/ M2 P
  -l size Send buffer size. : C! v- d$ }/ p/ U
  
% @5 o  D( n7 ~  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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