返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
- n/ r6 K, v1 M# x5 U/ i  
  l; K/ ?$ D7 [9 ?2 t5 `, n' B  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , k# g3 A6 e( R; t' H$ g
  
- G3 E$ a! y2 i1 Y1 _% v0 h  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
0 T+ ]% C6 [6 t, r  n: W   7 Q. ?& y6 b3 S6 m2 t% n4 P
  Options:
7 m& X7 g. N( O6 D/ ~* X  
& z- E7 e- i4 c7 p+ X% @  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
; J+ S& v0 e" d1 Y) l+ \2 t' L/ u/ j   , z+ j/ X/ y( Z6 z. ]0 i
  不停的ping地方主机,直到你按下Control-C。 : l" U! g8 s( s6 v9 \% ^+ w
  
: t# n8 w7 U; s' z- G9 m: V  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
3 j% n( F2 K  r) c: A8 ]2 r: A   9 `; F# f8 f" g- T( l- }
  -a Resolve addresses to hostnames. * ]& s6 Z$ Y( X8 b8 i! q
  
! ]$ P! S8 S0 _1 O1 }3 S  解析计算机NetBios名。 2 X# l5 Z+ d) H+ o7 y& b% K; Y9 X
  
/ M2 d& v# _1 M+ ~  P  示例:C:\>ping -a 192.168.1.21   G0 |' i% ^  C$ C, _* j
   / o; B0 y: T' C" e1 t
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 0 M3 x4 O6 l) F& C/ A* I
  
( {% z- v! E( K1 l, J  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % g. X- q; v9 ^# j
  
$ q: b' \) n& b8 b3 P6 T  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 X' S: b8 T7 b! D; b3 ]8 M9 ?2 v
   1 }( I5 r6 ~6 ?( G4 I+ y7 i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% m; u; R+ b3 s
' v9 a  r. }/ K0 x: I0 d$ |   & o1 P" i+ j/ ~4 J
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 Z- V7 w: J+ t   $ K6 ~/ h( z) Q  E  T4 Z* [
  Ping statistics for 192.168.1.21: ( z: {  h( D% `8 V, u' }5 K+ E8 g
  
! u/ Z9 c3 i* x* S' l, w# ~* {  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 9 m! c6 @3 x% \9 a' j+ p. i
  
% O1 n) x8 I8 O8 e  Minimum = 0ms, Maximum = 0ms, Average = 0ms
' J; G3 x- x. a( D  B8 a- _   ) n& [" S9 ?4 P1 Z8 f" N% j+ H
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
1 |3 Y/ d9 s, {( c) c% U2 p   % w7 d5 t5 [* e& g
  -n count Number of echo requests to send. 5 x7 [' b* t; ]
   3 C9 j; T% Z% W& z/ Q
  发送count指定的Echo数据包数。
) {# c$ W) p' L7 Q7 ]! D  
3 f5 @" R) n  x  f$ i& y1 L% _* v" n  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: + m: b( {) j1 c! J
  
7 ]& d' Q, _4 D: ]6 X  C:\>ping -n 50 202.103.96.68
( S3 D* k# ~0 p  
* H# j' \2 ^! \0 \/ S  Pinging 202.103.96.68 with 32 bytes of data:
1 T- E" w7 A- c- L) f" I. S) |) ~$ D8 B  
  A- \0 f; C  G1 J+ G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 _1 I' O" G- f& ?9 V& X. _9 _
   ' o; U/ @( l3 h9 i& I5 s, D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! `2 [$ T# A# m4 S3 K
  
+ {* k! X4 F- V; ]. Q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 ~/ V" O) @( [3 V
  
- O8 g- e5 X! [0 ]+ a3 b# z( v  Request timed out. , P4 |4 p1 a% o9 T
  
1 [3 J$ W, M8 \3 H$ s" i  ……………… & t8 V+ [9 `+ O: Z. u; e
  
. ]$ ~' c  M) b" a9 j6 c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! a: E+ G* r% T. k  
3 z" ~' M$ R* I9 p* \& y: q; w& X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 v8 ^+ J% C, M, e# X! t  
4 P4 [+ Q. w% v7 {, m2 `  Ping statistics for 202.103.96.68: $ L7 D# R7 E5 g3 Z! F1 V5 u
  
4 \* a, I) h# H  k. G8 ^  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
! i/ e$ l: P: R) b7 ^  j6 W   " U4 i0 b( h' T, C" |( B) X
  Minimum = 40ms, Maximum = 51ms, Average = 46ms " s4 ~( ^) z! ~% e4 P2 @
   " X0 A4 J. x, h* D+ C5 z
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
$ R# F% Z) z1 p$ s   ; Q; @8 c: R( f  e
  -l size Send buffer size.
1 @, w5 L6 U8 [& `1 _- X# B$ @   + ?3 Y. ^" Q. B; Z/ @
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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