返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
' ^! J! J& c0 |0 P  
/ B+ r! ~$ b& a7 K( v  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
; `: v6 x9 T/ P' Q  
* }: x/ O" _7 [. x; o1 Q( V3 @7 ^  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 / \6 c6 v1 U% R: `! @
   9 B/ d& L4 ~% \) M9 j8 W7 |
  Options: 6 c( e# w8 g* ]$ c1 O" @
   3 E- W  c4 E6 H) [2 ]
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 u  ^- {9 Z, k' ~7 E2 L1 t" p  [
  
. ]$ j& x& A$ \. N  不停的ping地方主机,直到你按下Control-C。   v5 [% c& p% _8 e6 z4 C/ B' p
   7 z; O+ h$ A, {/ Q! S
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ; k/ d8 c) s1 T
  
4 D. k+ R; l7 m  `; ~1 Z  -a Resolve addresses to hostnames.
& T! y% ]+ V, O8 e% T. ^  
7 _' P% f5 b/ L! Y# }  解析计算机NetBios名。
; P& z9 [' m5 o) Z2 h   # P  w! R5 B% l) C$ F
  示例:C:\>ping -a 192.168.1.21 ; }8 m" q  X7 \  v! M" K
  
. a, S  o8 k* E& t  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 I: S. s. r5 w' J5 g+ j- Y   2 N8 {$ F8 E- b9 D% g* D0 j( i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" D& g0 l; W* r   * ?, D$ J4 j- m/ \& Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * E% W. @4 m2 g
  
5 v' S9 i' [3 @. w; ~6 w  g7 z. ~  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ Z0 w& T6 W2 w/ u' Z( c- }" G! x6 a
  
6 K7 O, u( S* T9 A. {1 k  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 O, u7 c% D3 C! a* g0 Q$ k( J   & j3 y) g! ^& ~! b1 h
  Ping statistics for 192.168.1.21:
- ^8 G2 U: k4 i7 d' a  
4 D: ^7 X0 S4 p8 G9 O2 Q  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: * z8 Q& v4 q3 s) |; l) G+ M8 Q
   + I$ N3 {) Z" Q' r
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 5 s  N' x$ }1 _9 ^* Z
   # L8 U5 _: p& \# Y* [$ y, Z
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
; E, D* V: W" a3 o3 u1 `   5 o. ]3 A5 o  ?/ S5 e9 U
  -n count Number of echo requests to send. 0 Q1 H* \6 v: R
   1 c. B: R# B1 r: T8 E; L- x4 m1 x
  发送count指定的Echo数据包数。
2 ^. ^' }; e+ c$ V   3 ^8 Z  a  P) b
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: * j# v! _, _$ _2 U
  
7 }9 ?! Q; \+ D* t  C:\>ping -n 50 202.103.96.68 6 a4 [: K. I8 I& s5 Y; v" y
   / S4 R" g  d/ C5 p- G. k
  Pinging 202.103.96.68 with 32 bytes of data: 7 z5 i3 a+ R! e( ]2 L* q
  
. a8 C7 i2 |0 a- \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 g! e- \8 I% K  T# d; s
   8 ?  l6 J; F( b! q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: h" {/ \2 S8 s% C; f; j  
6 |! r4 {4 T  X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 j& }2 @# \: L& R& E
   , e- z9 a! Y& e. |) D7 Q: v
  Request timed out.
( M: w: [8 t; C" A* c; |* h7 {  
( t! X5 P6 q. X) e/ P  h  ……………… 2 Z; \6 f$ q9 P) i
  
3 O4 h2 h, t, e2 _. w  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, G  k+ y& \: j  
; C. f: b1 l/ q6 T5 p+ G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 |' {2 @( A1 S& |" p# R
   ) w3 S- L# T* |' W
  Ping statistics for 202.103.96.68:
, \. d* b5 ?* M" v1 P   2 X8 v% w9 B2 r( ?( E; U5 z6 n
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 1 f: p; J  F  E1 K* d' c
  
% D! @& m( q6 I' t2 Q$ [  Minimum = 40ms, Maximum = 51ms, Average = 46ms : U: L, Y1 E; c" d/ H5 @4 c
   ( W# Z$ @5 v& L8 C  h  E) b2 S
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 & a( c' y7 @9 i5 d, U. H
   ; x8 h; g) s) r: y8 k, L9 k
  -l size Send buffer size.
3 q* T2 X7 U9 g* ]+ F; }& Z  
6 C& Y, ~# w( L- f8 r  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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