返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
9 u1 Y5 c& Z% m/ q  
2 R/ v  ~  b+ }& |  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: # q/ I8 j* |* ?2 M& u7 G
  
) i- |3 ^9 m1 D; p# x" v  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 ; k% Y) j: _  R; a, v
   ' G& Y% |, {- x" f" K
  Options: ' f; `# S" _: |6 F
   6 e& @- j( L. Z  R/ F( }
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - X: |. q7 D( S; v( ^& v
  
! ?0 S4 W  {5 s7 ^  w  不停的ping地方主机,直到你按下Control-C。
' f) T' s$ @. y  
1 ?' P6 t! s' l4 l: E- a4 s5 q  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
* A5 d) c- }! \   ! z5 t8 Z& N$ b/ `! s5 n
  -a Resolve addresses to hostnames. 3 ]! B( l7 t0 Y1 N5 r
  
9 c, {! u  d9 ~4 P1 A  解析计算机NetBios名。
) T9 X3 n6 n$ k; Z8 v* L   2 K6 |/ q2 C! \; Y% L6 L9 f: P
  示例:C:\>ping -a 192.168.1.21
7 C" U, `1 }( V- N   5 J! L1 O$ ~' Z9 Q/ h8 H
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 4 g' p) s) W2 ]: }
   5 Q+ P0 R3 V! h% S% Z. D" Y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' y: e% w  t) |8 a: r6 D   ( [* [: B( E& c) k6 I; }4 p! Z+ \2 [
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, v" U$ z. v- L  
. F, G; B% h/ R7 u, \9 \  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 C+ a! x/ d# p6 W: d, i
- O# x4 h& j8 [" m3 J% _0 O% m  
% V: b- I% O/ w  k0 }0 D0 P  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 B* |& _) V% V/ J) v, r, M  d   + h5 l4 q  K  [6 e6 I$ P
  Ping statistics for 192.168.1.21:
# G% S: u2 N/ g8 m. v  
& `; |( C  G  q  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
- s2 ^- d3 k4 w+ \, @1 ~) p  
% [9 u" S7 X! f- a+ j* w& C  Minimum = 0ms, Maximum = 0ms, Average = 0ms 6 z: J- |$ t' @7 [+ \0 Y- v, A
   + O7 z+ {, T" X9 o9 H' Z( k
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
2 z8 V1 g* W* t* Q   * K! U" E, N; j0 Y: N; V
  -n count Number of echo requests to send. 3 e! e+ g- q" h5 \6 O
  
2 V; [9 C/ F8 ~; u  发送count指定的Echo数据包数。
/ u3 i" h& n& O% g& u, ~- P  
! Q; e* j! o4 R- y7 j6 h% q  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
2 w* F  L7 n0 }* n  
4 F6 X  [: o$ g: P  C:\>ping -n 50 202.103.96.68 1 n5 O+ W  A- o% k6 |. t2 K  L
   - r% s% @" n8 e' P$ p
  Pinging 202.103.96.68 with 32 bytes of data: : `9 S+ z" K# B1 C/ T5 k, i5 Y3 r
  
  S, }. k' j+ ~& L) W$ r; B  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 n. ^, x% s. K% ?" s  R3 u
  
+ H! j+ v$ f4 M9 {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  T# A9 I# D1 h: C  
( B, W5 Y5 {! _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : G# C, D$ h0 f- n7 m
  
9 v7 X4 B9 ~+ d- V' S2 p/ I" U  Request timed out. ( O; x0 O; C# l* i5 O
  
$ [  W# Z1 T; S6 H2 `; G  ………………
" v& Y5 e- t: C. t! d, @+ }   2 B! t7 M: ?+ ^. b0 R8 o
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 X2 t/ q! G$ Y( D  
3 y  P# d: M' g  z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   F6 Y+ U/ W: a
   4 V) n! J2 S7 \) t6 o3 J* g
  Ping statistics for 202.103.96.68:
8 N8 H; ?# U: U2 |  
- p9 O$ Y3 @$ K: z+ }) k  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
2 C1 d0 d' v7 V9 E  
3 ?- c. ^/ w) b/ [: y! {' u  Minimum = 40ms, Maximum = 51ms, Average = 46ms , A* J& ^# m7 w+ P8 K& `
   3 p' u8 Y( ~! N* G- C
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
$ t1 W- R5 E! @  
* e* @4 R% d) ~" }  -l size Send buffer size.
# \' Z6 D/ Q+ \; T& h/ i2 E  N% N   0 k2 {  e1 [/ r: O, i; |1 s' Z! s
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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