返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
7 k: V5 O0 |4 o; `. E4 r& h  X  
. b3 {2 x6 S& J3 U  v  c  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
0 g2 [* o* |3 P4 K! F   ' g9 z% j; Q: s
  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
: \% A) ~9 b. e& v% k0 \7 W   7 p/ U9 ?$ @$ `  @
  Options:
7 O7 b: l9 \$ s$ I   ; l, w% D/ x1 M& T
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
. w5 C7 _( `+ g$ Y- V  
# r- ^$ N6 f) D3 _. E% D  不停的ping地方主机,直到你按下Control-C。 % [$ \$ u6 k& O6 R* v2 a# l
  
$ k6 f+ n3 g" `7 I9 e  _  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 % R  N( |, ]5 a* s! t4 z1 f' Q
   , h: P; n. G( J( u% ]4 e
  -a Resolve addresses to hostnames.
. t9 U( i) f" s9 N# x3 }   7 `4 n- |- I% m7 E
  解析计算机NetBios名。
. r  G9 E. F: l/ q) `& L  
. y0 f/ L! g) r: m, q5 K/ ~  示例:C:\>ping -a 192.168.1.21
9 P% M; F& R  k( p  
. F1 W  D/ V- s$ q  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: . D, W2 \! F% |  V% _* k9 e
  
  D/ S/ b; W: L) e- C! X  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 F; M* K/ v* j( f. Q6 H; Y/ Y
  
1 ^9 c2 G9 f! R. {) H) p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ p7 N! \! E+ r5 N1 W  e7 i  e+ s/ P, P  
; O0 r/ T! K$ F( L9 C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 [2 m2 P: L& h# {! Z9 D3 M" ^# K
- g% G3 z3 r7 ~- q2 f) M' o, X
  
) J* d: t* x3 L1 c* `- Z9 D$ }' q* j/ d  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! l6 ]8 Y1 d- g7 G- p  
2 b" U4 V% i3 K5 Z% H$ c4 v  Ping statistics for 192.168.1.21: # i/ u! O5 r: \  h
  
' t9 d9 m" g: [/ z7 l  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
( a& K( A/ U! X. f   ! W! H, L2 |0 p5 L
  Minimum = 0ms, Maximum = 0ms, Average = 0ms & j- y+ K0 K2 `2 i; @' B  |$ N* o$ p
  
# M) e* D6 t3 C  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" c. _* k9 B/ o. z& X  J  
* a1 C7 l' N% D9 N; ?% A  -n count Number of echo requests to send. / d. Q4 H. A9 ~; r2 r
   2 q( `9 M% V3 d: a$ w- [6 E
  发送count指定的Echo数据包数。 * u: A' p: P2 [3 a4 @, T- ^* }
   1 `" Z5 Y8 \" b6 {$ C
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: + X; x# S: \, ~, N1 I; a
   ) w* l5 R; Z$ b: `
  C:\>ping -n 50 202.103.96.68
" w1 f& b. A3 \( }2 D0 D9 k* N   . `6 c/ R9 h5 O) }  X
  Pinging 202.103.96.68 with 32 bytes of data:
! }, ?/ Z+ C! Z% W) h7 X3 K* J  
4 u2 g" N" e) t1 v; t  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + @' E0 v2 ^- s% z6 n
  
* Z0 _$ m9 K6 j# |6 ~7 _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # T1 b, M- V1 f& ]' d& B
  
1 u( L7 P# w- `# h" `7 S& ?  s: Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 d0 i: q$ V: [! d
  
8 }6 s$ A+ y* x' @% n  Request timed out. ' m# _& n( W- [1 m8 K5 E
  
, F1 G9 W! z3 h! w  ………………
  P. M0 W! x5 X   8 w0 J+ t/ n' B/ P* L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 `- ^5 c2 F7 D- W, [" R
  
: W* `& ]+ @  R* X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 l% v+ H% \0 V1 F; M; C# ~   + Q+ {+ `  n8 u" t7 k' u1 m
  Ping statistics for 202.103.96.68: 8 k/ J- k' E0 J& D0 S: ^) X
  
; H4 E0 i) X: O$ @/ s  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: + H/ c7 k2 h8 w; j# d* j: Z
  
8 n8 x4 H2 |! n4 M; J) d# n  Minimum = 40ms, Maximum = 51ms, Average = 46ms # ]; ], O5 v3 \7 H* _
  
3 {4 i* S0 K( M; A  V  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
# z, L1 Q, A' J3 z1 f( u7 w  
, x# p4 V& p0 l; |# z7 c; q  -l size Send buffer size. 1 Y1 L/ f& o% K# n0 a. [$ s, h
   / \  k) i" T# u7 |) C0 ~
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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