获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ! F$ x4 V. _# Q; R9 h! U+ i
  
5 q6 i" ^- _. }6 w6 j8 Z* c/ t  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
- t$ Q) s6 X, ^1 n5 [5 n   ( N; V( Z$ B  a# U4 ?7 \5 O+ ]
  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 b1 S* p: N, A, x' k2 ~
   6 V: G" d: Q  f; Y: C$ w' X+ b
  Options:
7 G3 f7 n( r0 N) `4 P  
' S0 Q) F5 y, g8 i. j9 `- ~  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. . u& Z1 a5 B' R% I( X
   , f: ?4 I: y8 h' r+ g
  不停的ping地方主机,直到你按下Control-C。
# Y' o) {1 a! [- A  
' z' S. S! i: [' C( k  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。   a( S4 N, C8 I+ i# y
  
( |* a: Q1 I0 y+ q. S  -a Resolve addresses to hostnames. : i  ?- s1 G! C% u4 P4 ?* O
   3 V; \+ q* W. g: X. `3 A5 D
  解析计算机NetBios名。 3 G9 ~2 T, ?5 S5 `+ `+ k1 w* U
   ' b+ b( j8 z# {1 n4 R4 h# V
  示例:C:\>ping -a 192.168.1.21 / P( Y( b4 ~1 [* ?0 y4 U" K: [
   8 X' c4 A+ T9 t
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: & z, w, @* P, w( ]5 a; e% b0 P
   + j3 F% ~1 W4 _' {0 p9 j
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 l. R& L/ z+ s% ?9 v   0 z* d+ A9 @' i$ p4 T5 h# i* l% A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ d% e8 _- X! s0 [* }+ Y2 N   ' t+ O& M! _( {3 ?) o+ X* P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ E! b3 o. m' X- ^, \9 O
- N' _5 b. N% C; j+ m: F4 s
   4 v' q% t9 d, k3 n3 z% @0 m& v6 ?
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " ^8 h- z" C1 K. }- d- H
   - R* ?- C; A2 J" O1 d
  Ping statistics for 192.168.1.21: 4 e( v! m, {3 p
   9 j) {/ {9 Z1 p
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
$ A) r% K' m: v7 ?9 r1 S   : E& o3 R1 S$ j- t
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
- |! g3 s% m* x, F! n! M' O& x  
3 r# V- u9 k2 A4 b& B# T& W& g  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
- E: G1 N5 L6 ?- ]  
, F& S: I; `/ }9 {3 v  -n count Number of echo requests to send. ; X0 E; ?5 K$ ^5 M
  
; `9 g0 o+ d8 F4 s" Y  发送count指定的Echo数据包数。
: D  B! @5 U: n, V& Q   $ C1 ]+ ~- C& p6 H, J! _
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
& h1 ^8 N- ~7 K   + K3 x$ U; W% c' p
  C:\>ping -n 50 202.103.96.68 " x3 I9 ^3 o7 w
  
- `! E' O7 q* |: C9 a  Pinging 202.103.96.68 with 32 bytes of data:
' |- L& p0 n/ W, D5 ~7 h6 L% n   $ `. @8 e! r$ w
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( z) o! p1 v" e6 `6 I; A5 _
   ( k# ~' k0 z8 B; n) G/ B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * H. P4 a! I8 [$ J1 K" p: n1 B# L
  
( R- j* Q# w1 S# B( d7 [! v  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 ]/ d0 q, P, A7 y4 a8 b
   0 y2 h3 l& M. }" l; N
  Request timed out. ' W# ]7 I* w9 [, T& M1 x
  
7 \9 g- k1 ?* I  ……………… ( Q" d3 V6 z0 j4 r
  
2 K+ p* g+ ]/ H; F: j  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - \" c: {9 ?6 n
   $ u' b# n! @1 H- [0 S
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 Y; T/ k2 s; v   6 K+ W, \# G) }9 N
  Ping statistics for 202.103.96.68: 1 H; h: j0 s+ o) }1 \
  
9 `/ N( ~- v# w& X5 b0 L  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: $ o) E- ], {" [, A
   9 M& b( A( r' z0 C! f' p' X. Y2 {
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ' P6 `3 G! J& A! l4 @4 G
   6 o1 _9 {1 w( y3 W0 n) b1 K
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ! P1 m* C+ V2 A+ F+ e8 v, c- V
  
5 Q7 O. S2 h9 }7 |& K  -l size Send buffer size.
8 e6 }7 S# \) R  E! D   ) \0 y! r$ d/ {& ?2 c4 |
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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