返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
$ P- F: n: ~# }6 z" V  
9 z/ B; I, _! X  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
$ ~4 E1 M0 Y6 L1 N9 m3 h   0 L9 d0 m. {. \. P
  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
- e1 E2 D! _, z/ u, s5 C5 r- Q  
2 \& a, n; ^# }* ]2 X  Options:
" A. L, E6 b4 e* c% {0 O) }# n9 ?( P4 K$ I   , T- h8 D3 z" G* j) {4 S% V3 b
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
8 v/ i) ^2 g) |8 L+ E   + J0 x; L* Q2 D' g" K
  不停的ping地方主机,直到你按下Control-C。 ) I6 I* f8 |$ a, b1 e+ W
   3 e- l, ], @6 I* M3 w* v9 ^0 `
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
/ {2 }' @% U# F8 x3 h( X   ) z6 Z8 u. {/ [! [
  -a Resolve addresses to hostnames.
+ C  e( ]+ I: G4 @" ?5 ^2 ?   ( Y. q; u" r, y8 D
  解析计算机NetBios名。 ' ?/ s5 |) x- ]+ P, L7 b" K
   % n- }- ]! I3 [5 j4 v! U% K
  示例:C:\>ping -a 192.168.1.21 - i2 B; d$ U* O: L
   7 {7 r% p9 o/ a* w, ?# x
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ' p  h3 Z+ T3 T1 E* O) e/ v
   & l% s; S  N; i8 R1 G2 M* T* Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: D) c9 v# a+ ]5 h/ V: |- J, E% ~" F  
5 x* ~& [+ Y* H' S+ N, X  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* J* X  q7 b9 l: Y9 j   1 @, S2 o5 Q  D  w) j
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " `4 [, D& }1 Q9 D1 H8 h
6 |9 o6 f& z2 g: o1 G
  
+ C& T/ K- u, h( k' m7 D  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 T) o& C) E; k( {5 c
  
* ^( T3 M; R  u0 b7 r; W6 p$ n( M9 U  Ping statistics for 192.168.1.21: ' K* ]& t. o& }" v7 M1 G
  
. v( ?! c0 I" Y7 G* o  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: & I* G3 m: Y- f
   9 j: I( `7 [1 G( K& o3 r* `
  Minimum = 0ms, Maximum = 0ms, Average = 0ms " Z! c7 @' c3 |
   $ d8 Y& }! V+ `
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 8 G1 `8 B- y9 ?& w5 V: F
  
! D" y* F" K  t9 v! {/ |  -n count Number of echo requests to send. + s7 L! }, }- E: M6 G
  
4 m; B7 j) p3 _, j0 U6 s  发送count指定的Echo数据包数。 5 Z1 G; S' @3 u  z
   6 o6 I- S) l5 O+ }9 Y% c
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
; }& t; i' C, L% \- S  
0 j; ~& G% a! ~, b  C:\>ping -n 50 202.103.96.68 ' ^$ f- }( P2 t; j  F0 \9 s  P
   $ ?6 Y# b( `2 E1 o0 H% V
  Pinging 202.103.96.68 with 32 bytes of data: ! h+ l: }/ Z" N  m1 j
  
3 T5 D' g! g& l3 ~% \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  `7 r* ?% q- U! F   ) P8 ]  T4 X  t
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; H4 U7 H7 q2 L$ f- x/ u% {8 u   " u- E2 ]+ f0 m- B7 K' K0 N1 x: m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 {. p3 j2 e) z: z; R   : E; p$ L1 _) S' X
  Request timed out. , g  I8 `" |+ s9 q
  
, ~4 e$ _5 W, C5 w% h; S  ……………… 0 {3 h4 z- c- m
  
, t. q* S9 ], V3 u+ U  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 ^5 d2 S% w" ?  m5 e3 e
   ( J, Q7 S/ z5 P+ s# p* ~& R+ d% O, L/ c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ Z1 [/ d1 @7 }! B, ]# _" I9 c  
) e# {. n! R. b8 o  Ping statistics for 202.103.96.68: , ~+ N3 q" q# {6 T
  
) ]5 |6 s7 |2 s. H& g. |  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 5 v% {( h+ ^+ r' u3 |+ W% N& h
  
5 M5 F7 O- ]0 X4 h, @& d& N  Z  Minimum = 40ms, Maximum = 51ms, Average = 46ms 2 K& f* ?6 o$ p9 U8 C$ I
  
1 ]5 l* y7 ^7 E8 H8 P' D9 `  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
, c0 C( V0 `$ }" m" Q7 D" e  
# ^* `+ q8 L0 d( T1 ~( U% g  -l size Send buffer size. # q5 u- B$ ~. q# y
   5 X+ ?% {6 i1 M! C! a+ L, O% r% D% \
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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