返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
- j( y7 {7 E2 {0 Q  o! n   $ K- T9 o) F3 A+ D
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ; M8 ?+ D# C/ ~- {* p8 O
   ; j. }6 W$ G3 c9 ^# c" ?0 a# 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
# Z% i( S, M: h$ Q: }" _  
/ i( X0 R0 z; R& @3 g  Options: . z2 G3 @+ k7 ?' L
   ! a: ?. m5 b6 V% t3 C7 a
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( z4 P& y5 v3 ]6 k
   * S5 \5 _* R; W0 _
  不停的ping地方主机,直到你按下Control-C。 6 _% _2 D6 U. \: I( t- C! d
     A0 R; W$ D: }2 P) n8 Q" {( n
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
9 ]8 r% O+ o9 |4 E   9 U. n' V! t, S2 D
  -a Resolve addresses to hostnames.
4 k4 x& o0 ^3 n1 j3 t; }- w; `     s, H+ {( Y$ `, a* u7 y5 w
  解析计算机NetBios名。   G& x5 |' t8 O% Z* P
   3 m% T3 E6 `& G* ~: ]: K
  示例:C:\>ping -a 192.168.1.21 4 `" {. y' R. x  o! C& K
  
5 I* g/ B9 ]3 d/ @2 l  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: : v0 @! n  c/ u- [8 K! }* b
   , N* B/ w: K. P6 E0 t" E8 ^
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 d, s0 @; r, r/ E' I
  
4 K4 q/ O* f5 V5 [  q' n; Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 Y+ f( {8 X. G* N
  
# f0 h( y- N  l) }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 e% `) k7 Q) V1 x/ \- K0 ?" s1 h- u. A$ P" G
  
' M$ ?1 S( Y* T$ c  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , b6 F4 S' r7 x1 ]$ `5 U
  
! F$ |8 C# M0 h, n6 {  _  Ping statistics for 192.168.1.21:
' q! C' m! y# l& Y  }! @  
2 J( T; \6 M6 P  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
) s$ P5 y5 P7 z5 Z   % J8 K' F9 |5 ?7 c
  Minimum = 0ms, Maximum = 0ms, Average = 0ms # H' t$ m+ ?1 i8 v4 q! q6 g
   " h8 L8 I" F* E; G; p5 s; H. g4 K
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 & ]- [# F! X* V% _5 c+ |  r6 O
   - {! L  K- W  P% I& {
  -n count Number of echo requests to send.
% V/ `' y# g/ P  
. t8 ^( a8 n  q8 }7 ^  发送count指定的Echo数据包数。
+ a: E  \3 c1 c; a# L  
7 {7 u6 |/ W( E  c+ Y/ K  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
, ?+ [3 k$ k, e' I3 ~# w  
* I. X" f" Y( W5 A* @( X) Q: v  C:\>ping -n 50 202.103.96.68
8 H9 l" B+ N  k   " @( d8 ^3 X0 s9 I2 e
  Pinging 202.103.96.68 with 32 bytes of data:
* \  H- A. I' F  o% y8 m3 M, P  
0 ]" N& l1 z' ]: m  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 `( `+ G; p. q' F
  
! D* M; f& U, W, L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ I+ S8 R2 Z  C& H7 H' q  
/ z# h: _3 \1 r# c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; @4 |9 f1 m3 y   8 d0 W, o, g3 R  _' K4 I) Z9 v
  Request timed out.   S6 F- ?% _0 R; r
   ; Z( y8 D1 W+ w% b+ r
  ………………
0 e+ J( D% m. z' h, W$ J- w   # s3 N$ ]1 {3 W3 p9 x
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 H; r4 l( M; t, j7 W, L  
6 [8 \" m+ C, j& G) K  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: ~+ |$ }# i* \1 ^+ D  
2 t* u, L7 V3 ~9 a  Ping statistics for 202.103.96.68: 6 B. Q1 Q8 a" P0 j) g; X/ s* {
   . {2 ?. S  U) e* N
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: * v  r' ^4 b, x8 `
   - Y) c: [' A; q* J$ k6 f
  Minimum = 40ms, Maximum = 51ms, Average = 46ms - i/ p) W+ a* Z5 Z" A  F. g3 h9 o
  
7 D/ P# L1 ~0 n$ Z) j& f  \  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
/ U3 `1 A5 ^& D8 N   & `+ }  O* \" l& I2 F& R
  -l size Send buffer size. ( u2 H" b4 A2 M. g3 z
  
) H! a' H* C; K+ q# Y0 ^6 W- C9 T  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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