返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ' n7 C: q. c' e; G/ p  N
   0 _; J! J& ~* x' R: x3 i
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: # S1 m: D- z: o; G8 m2 R. `
   8 Y' I& Q! x9 y9 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 ( i# i) ]8 K& i% p
  
9 ?6 Y) P0 W/ p- U( V  Options: 8 u; o1 z" z+ R* [  ^
  
! h2 s4 _% L  y1 f, s( R  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
( q3 V. f, B) z' g/ P4 C7 A5 P   0 |" G! m3 }9 l( M3 ^  T
  不停的ping地方主机,直到你按下Control-C。 , Z6 t- k: `! |
  
! e& c% {; U' r+ M  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 / C$ ^6 x1 q) \" E* x  C+ Z2 i- P
  
" B4 W  i! v5 l$ x4 O* y, G  -a Resolve addresses to hostnames. $ i; t5 c. f2 Z7 R$ S
  
2 [; @3 Q9 M* l* i  解析计算机NetBios名。
# q. L9 m6 o6 k7 @" M8 _   * |, Z) Z9 I0 H6 m& \0 @& p9 \
  示例:C:\>ping -a 192.168.1.21
, v; |9 K8 R# q   % q# ]6 }' R# \3 {# i+ M0 j# A
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
" ]; e7 a8 w9 H+ `, j. ~   $ Q, M4 W5 M  S' e/ L
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 l5 {# b7 F7 B1 Y; l  
5 p3 H8 \5 o' V6 z  u, F  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 g3 v* k& [) {+ ]( o5 B
   # X# ^, X/ n$ W" i  F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* ]; {: h" m1 `) j5 p4 _( h$ G1 ]) }# P/ c% _
  
+ S0 _0 m+ W0 w( m: ^1 Q; G, i  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 ^7 O( X* a7 C  
( @3 N- p+ F( P: h& x. d; p- {  Ping statistics for 192.168.1.21:
: w% `( i/ P6 n/ V, _; b  
% b( G! k; L7 G( L8 v( x* B. r  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ; v2 l- t1 P' e9 _
   2 V" R2 e4 p3 S! K/ T
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
" }1 l4 r) m$ [+ e' `, t  
5 D4 V( ?; ]9 K: t. k; [5 }  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 % `& U. B$ `5 e, k
  
( ^+ g4 |- E7 T7 n; b  -n count Number of echo requests to send.
8 }, Q; I7 ~) g' k  
: Q  K5 ?6 ~8 h5 {' N7 w3 ^; p  发送count指定的Echo数据包数。 2 Y! Q. x* Z0 c3 n
  
( G' |6 v! N/ {3 i; ]- n  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ) G7 P( b$ M& H
  
* R4 c8 E, I% m) s3 ?# Q! U+ }  C:\>ping -n 50 202.103.96.68 + F  u+ p3 b5 U8 Y. I" J( J5 R
  
$ O, {7 M2 x/ p6 s* Z  V. I, j  Pinging 202.103.96.68 with 32 bytes of data: $ G3 |" R# Z" _
  
; [3 w  c3 h3 n) W9 t  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- l2 B0 x5 h& G' a  F* H  
/ Z. [1 B8 w2 a9 x, g& {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " ^5 M6 P8 \2 x
   % [$ \( I) V3 ^* e$ d
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 x  J  n9 ]# c0 }6 G; f( G7 i   " S$ d) w) `: s4 r" H/ P+ X
  Request timed out.
7 X3 V4 Q7 B8 i) Z2 u   ) M* B+ f! H- ]2 {' T! y( \
  ………………
. V/ t# u, m7 [) n4 ^" }/ v' G, D) r( K  
2 U# K9 O. ~1 k+ Q& M4 `  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * H4 |- h- @* C! O
  
3 ^- D3 l+ L: t2 Z' v  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, O$ t* l2 B7 h; D9 A# ^" T  
( }* y; ^1 {- C  Ping statistics for 202.103.96.68: & @( A: ^) ]- s: p3 D: d
   " y. y$ `" i: a% _& u5 k
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
% ^4 d( {; @* C# Q& f+ N+ a( O   ! m. `% R( f: K; H& W9 N
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ' \; t% r6 P6 \+ U9 w2 j' c
  
5 J  F5 D. u$ D" D! K  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 : R% l. j, ]9 e) a
   " t% P/ X, L- e/ c4 d
  -l size Send buffer size. ) O+ I' ^2 `: Q: w2 S
   % }4 O, \+ Z8 D  |  W+ a5 Y
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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