返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
; L( y$ z- h( u5 c  
8 x" r/ m& O$ M" F( z6 M( K$ V  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 5 ~! U4 @9 L8 q1 ^
   ) F+ M' ^9 Z) ]; W0 n& f& p
  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 * `9 z, A. a2 L) e/ p  G
  
" o6 t  H& S0 g  Options: ; e( p0 M+ v/ n/ M8 Q. S0 ~$ Q
   # n8 e# C. }6 |
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. / K2 N: j: S5 S/ V
   ' b4 {3 [, J5 @: w
  不停的ping地方主机,直到你按下Control-C。
' |# w" l; W# ]6 V6 _* v' L   ' H( {5 S, o% @  B7 s& W1 Z
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
7 h8 W! f( {8 }& J4 c  
3 C6 X" s. }: |8 V8 T  {! [  -a Resolve addresses to hostnames.
0 m: `' e  |" f* j% I  
% E- l: ^+ V. D  解析计算机NetBios名。 7 g. Z) |& C: d% x& {1 K  ^' i
   * ^# j# d5 G1 ?# |* k/ c: \
  示例:C:\>ping -a 192.168.1.21
! l2 M) q) t" d2 r) ~  
+ q! q% z$ v$ k9 A0 B  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
5 L+ D+ ^/ j& P0 ?   7 S! H' O7 t. b
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 B5 t8 Z1 g6 ^' L5 x! j) z( B
   4 f2 @. D5 x( l1 h4 ]0 z  F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) t. m% r/ C9 t$ ]: u! J  
3 F& t0 ~! N5 a5 L" O6 D  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 v5 u2 V; X3 O  v8 M
9 u" ~9 r5 N$ }& F  }+ _+ l  
0 z. E* w7 f0 L6 q# X% z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- @  S' Y! t9 f( a- y   $ f7 B/ v: l7 _
  Ping statistics for 192.168.1.21:
- I& w0 t5 H7 H   6 Y6 f- O& k3 }, \/ W. `$ l
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 7 W4 {! C6 D; I3 J2 z& J! W
  
- y9 o, i( A% T  Minimum = 0ms, Maximum = 0ms, Average = 0ms
4 _! \5 Y# q5 F& M9 J) h  
2 T2 B5 t0 B4 U' N% B  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 4 J  v5 f. x8 q' q
  
- O& ?& p* `$ D% x  -n count Number of echo requests to send.
; t% Y; \3 |6 x' i9 M# R) z/ n   ) Z2 ?! K* t; e( I" A% B
  发送count指定的Echo数据包数。
9 H8 D: Z3 w* V+ F0 b   ' f- M0 r; K" _, _& l/ i5 Z
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ' w/ T) V6 W8 G/ I: }5 s
   4 m7 E( `: J- W1 F! b' f
  C:\>ping -n 50 202.103.96.68
6 w: t4 T, [+ o* V  N" I# V  
2 z! Z+ `& a1 m1 h% `' h& l  D  Pinging 202.103.96.68 with 32 bytes of data:
3 ~* f! L; x# g4 B; o1 T  
6 d- m& r- I4 ]; q% N, X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 L6 j+ |# z. J0 |1 a# E' P  
0 V6 ^* M0 g- \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ t: q. {# Z  _- p# p
   ' e, @3 x8 d4 e2 D9 C9 c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # ?( c, D# S6 z; x
  
1 J' \, y' T! p& A( n9 `) f, D- O! }  Request timed out.
+ B& z! \7 X) L  
; o. v! c! b& y& K  ……………… ! b# J/ I! k* f; X' N0 Z( k
   1 X7 @4 x) a; }4 j$ m! e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, n- I' t4 @' U  y" d) d  
9 F% ~6 h+ _  }( B( s/ R  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ Z& l. q# T  _  
) z: b, `6 C& G+ A- }8 M  Ping statistics for 202.103.96.68:
* w# K7 y# [! c/ D  S4 N   7 G, {3 |# n  i2 B7 H3 N7 p
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
" E9 t0 D4 T. ^' U  V* p6 z  {" W   2 ~/ v$ T( r! `2 \5 t0 [
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
, W5 k9 m4 N# U# }, ?   0 k# _0 T9 a( {6 Y9 O( C
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
) R+ V2 Q! U0 U   * B( @0 P( Z. U$ z
  -l size Send buffer size.
6 E/ F: ~5 q/ k1 X  
6 @2 C7 A! {  d# a4 C3 n" ^% X  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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