返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 6 n3 @$ o# @8 o! C& T. H
   % r6 q% a* D$ R( e0 r6 Z/ B
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: " w6 @+ a# N8 I4 Y- J8 L- Y* ~
   9 U/ b# ]$ O/ J, U% @2 t
  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- k) b, O5 f; f5 q. e4 x4 Q   * W6 Z& q  U4 V! o& i
  Options: 3 ~1 l  {8 _! G  e0 Y8 Q& Q
  
1 w1 g! ^- h! J  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 3 m. {9 ^, G+ E) F# c
   8 z7 K9 B9 _+ w4 n4 p
  不停的ping地方主机,直到你按下Control-C。
/ e, A2 I2 O+ \" _/ w   6 {. y0 \( c) D; V& |% W
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ! Y8 x8 K! j0 Z/ d% F% X
  
8 T$ o3 H/ c% J- Z- T# f  -a Resolve addresses to hostnames.
6 Q$ r9 Z) A! X4 J* Q: \% T   ) U: d! f5 d$ b5 K3 G. I3 P6 y( ]
  解析计算机NetBios名。
7 u5 x! ?. U1 f; p- s2 ~2 G( ?9 J+ p& L   . c; ?5 z! [) \" f. m; t
  示例:C:\>ping -a 192.168.1.21 " @+ b2 }7 |7 d# a" o
   1 V0 M" x. P5 \, p0 l% G; f
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! U6 [; A# V3 N# N- I! p   / y3 h% A# f% n* P; ?5 D! w! v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 z8 U2 U' G5 s, B* A   6 X: a% s. x- N' }) B1 U! Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( j; u- e6 L' q% ]# @, P7 f* ]6 m  
5 h* d5 Z. ?- M, @  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; q) l# ?8 {$ p

( r2 K  G, j; E$ B" t   # F3 F" W$ ~( q; f
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 u  _# a7 \) Y+ z
   ! a) }' ~; z9 H9 P3 S7 a
  Ping statistics for 192.168.1.21: ( |) V8 F7 e" B; C4 m+ W
  
+ X+ b; M% ^) q: m. N7 _- K  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: . t) O: \8 e4 Y. [" h; f
   ; s5 [8 W0 _( q2 ~
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
! u( O1 L5 J7 |   & A* s3 \% `4 ~
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 }% T. a7 H9 P: Z# s
   7 t# \  F2 K, R" p3 `; `; M6 c
  -n count Number of echo requests to send. 0 F8 w( M7 e4 n( W5 S7 e! @- R$ V
   + S4 |8 \2 A9 d2 L! O- K% E
  发送count指定的Echo数据包数。
  k6 t! k' m% O# z   4 h$ L' J8 t: O0 d9 k% K! x) f8 O- r
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
0 v( d7 w/ w4 J! p, h   5 F/ {# b4 _6 t" d# U7 I' v
  C:\>ping -n 50 202.103.96.68 : A( v6 r7 @' R5 T3 o
   ) R# N$ N- Q7 p1 q8 J) j8 s" o
  Pinging 202.103.96.68 with 32 bytes of data: 8 N% b- d  ^1 {# j0 ?! `
  
7 y' y  \& o3 P- g6 Q! J% N# E  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 P7 U$ \. C( e+ \( W9 k  
2 P2 _( X6 n. R  ^# D7 f" B  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; @$ n* K9 L; }0 T6 R
   8 V  u( o$ y& B0 ]. H3 }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% b# ?/ [- P% t/ D& P: @& j   * y. [" Y( k9 T- d
  Request timed out. 4 z4 k; T& L2 b. ~" I0 N
  
# I2 o, y4 `: M9 w  a  ………………
7 A8 H: e! Q( I$ G   ! a' i' e8 [' B# o# M" f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 i& n+ y5 Y1 r) g; v  d  }  O* ~" _) o  
- l! b% l/ g9 X- o$ M* Y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % J' M# k! H& A7 h
  
) S# x0 f5 O# Z/ h* p  Ping statistics for 202.103.96.68: / J! P! Q& r9 ^. R% m3 _
  
" B% ^8 h3 l4 f& m. V  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
4 u4 s4 b) M1 q: ^0 W* L   8 a% G0 N# K/ Y7 g
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
* ?! k  N. k5 ]  
, T) o4 k0 \$ A+ E2 v  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ! v8 K# E8 S( [  {1 X9 v
  
. B% l! c# P' {  -l size Send buffer size. 8 g5 Z# h( n5 S
   ) `+ M' X+ o: Q4 e) q% z6 m3 [
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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