返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 / d7 X; o; H6 g6 P) D
   , A6 Z( @! m0 Q$ I
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
1 g6 f  |0 I8 W, Z) A  
3 g8 R0 X+ Z8 N  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 7 H) o$ r; t  o0 k
   1 @& M7 e8 m+ C
  Options:
# i3 F( P8 n& e  
3 c+ |5 X% p3 L% ^$ ]' P: ?, }  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
( e" k! @2 A$ x, P* Z' v   ! z. Q/ m9 @6 j' G1 q0 W5 t4 a4 [0 ]
  不停的ping地方主机,直到你按下Control-C。
# m) ?; n" H) }+ |  
# V' R  r1 j" `  j  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 0 r/ Z% w# r  @
  
: g) E( S! _! n! h2 U( L  -a Resolve addresses to hostnames.
  w0 `: b" r* j& r& j  
0 s' f0 Z, o$ @9 ]" {' U' `# @; z  解析计算机NetBios名。 ' v: M/ w5 D- _$ m# S
   4 ?  G2 h2 O) g# r: z. z1 b
  示例:C:\>ping -a 192.168.1.21
' [. f3 X: R8 m/ `* D4 n   7 \9 V1 }' f; P
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ) s; N" w* r) `. X
   2 @5 k- Y- R7 R) B9 x; I
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ n- V* T- e2 l4 ]: P7 c  
. c: u$ H% Q! W+ x, M  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# Q: m+ E. n2 I, W- Q  
) v, \. V' g1 E2 L4 y8 B( g  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 _2 b3 i# I: e! A. u
$ `2 `; ]% |0 `# r& \- B) o4 Z
  
/ h" w/ X7 A# x) K" v$ T  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- x5 r2 T" O  X- |7 }* j6 r   , @" P% x7 N* G+ u- C+ L
  Ping statistics for 192.168.1.21: 2 q: n7 I+ F# E1 p8 F- g: y
  
7 c- U! p0 V. G7 o  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 h: L7 m( [! z# e) K4 d- n   1 e) D& p) i' V
  Minimum = 0ms, Maximum = 0ms, Average = 0ms : ]. N/ t1 W5 a( N$ Z
   ( e. A3 \' ?5 `: d
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
1 V+ ?* I( G+ W+ H   , u2 Q. ]& c* s  u: Q0 a" ^3 e
  -n count Number of echo requests to send.
' F- |% t/ Z* L1 Y  i. @0 @   8 G* v/ o5 Z2 W/ Z. D
  发送count指定的Echo数据包数。 9 B8 U# X5 P2 X$ a% Z
   0 c0 b4 p. k. [5 P" m# X1 L( ?( G
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
: j8 \# x; \# L8 Y& o   1 ~; x) Q# v2 n. B# ?
  C:\>ping -n 50 202.103.96.68 . I% o# ^1 N+ F' B; E
  
$ |" v8 l3 p% X' T  Pinging 202.103.96.68 with 32 bytes of data: 0 o2 L1 J3 t& O8 ~2 `2 g: [0 U$ |
  
0 P9 l6 H; b$ G9 _: a" \- {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 B7 U& r5 k+ h$ L
   " D' x7 O+ G0 F* D( `% {
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 N& W" U. G4 O/ N
   5 _  ^3 A# @3 _; K" u
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : c+ P) s8 }( V  B0 e$ O
   - W/ M  e# K* g6 g. @: ^! e( \: G3 t, r
  Request timed out. % R+ U1 @5 l- r
   ( C' C5 c. f! E; @4 [
  ………………
# w! M2 E; M* ]% o   ' N+ C! e$ M4 s
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : N( ~, |" b. R7 y
  
' E1 ~9 h$ h; R3 f7 C8 P* j, V6 d' I; e& J  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! _2 @& F4 H4 V/ l   : I. v, h% f- c0 j. [+ h5 f
  Ping statistics for 202.103.96.68: 8 \1 K! x* L9 w7 z
   . W! @) i/ F& q9 V8 v: e( m
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: : o' P1 J: x+ O* }$ A
   6 \, k; p' ]! T7 {" A
  Minimum = 40ms, Maximum = 51ms, Average = 46ms $ K: \3 Q: A* G0 V. X1 S
  
9 N! K7 `* r# r6 d) L. O5 V  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 * m* u+ @' R( g/ d) s( s
  
, n0 Z% W4 H" ~, G# K% w  -l size Send buffer size. # H' P: f& s: Z0 F; }1 n( w2 F( a  k
   7 [: K6 I' P0 l2 T* V4 ^$ Y
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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