返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 4 I9 D6 j! q0 z- X
  
0 L( ]6 }- h# o# `( q  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: # O9 k1 O5 e' B- A) U. J6 ]
   ' U& L3 ^" e- D# B8 h$ Z  i0 u
  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 * _% F$ T$ J1 _# l. \; Q
   $ j6 D+ }( M2 ~' i4 u$ y
  Options: $ i3 D% `" Q3 ~8 o. [
  
; @# M4 }$ Z# k' l; k0 i  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ' }$ T* A2 l$ r# m- K
   - ~  q7 H0 j: R6 h
  不停的ping地方主机,直到你按下Control-C。 1 G- o, V6 `/ b+ Y4 W) k( P
   " {2 x; n' v& `  c( w/ H# M- g# r6 q
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 / I2 K0 W/ ^  t* F/ v) g1 n" y- S
  
8 r" _2 r: V! G1 ~) e9 |  x  -a Resolve addresses to hostnames. , ?, X1 f( V+ j% i
  
/ u# }' {6 g% E& I3 h$ ?) g  解析计算机NetBios名。
& v3 t! G6 @, ?) G6 f  
/ n8 Y0 f7 V: w+ ^  示例:C:\>ping -a 192.168.1.21
$ S+ n0 K( d, x; ^) e" p% k% _0 {  
5 @' i/ }; _0 Y& b* C, |  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
) x$ |- n  s' r6 R; E% M% P   ; s! Y9 e8 g- R
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" b4 k# E3 n1 \- e   7 n1 Z4 g4 s2 G  Z. D7 i" o  {
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 v  W5 k. |& @7 Z, |& u) S+ Y3 \
   1 g) a1 s3 \& t
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 A. A8 J1 d: M4 c: X+ `, r6 H6 O  }5 e  K+ u
  
: n  d" [% a5 ^% E. ?$ G0 \( E; h  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 A7 Y2 m3 T5 Q! g+ I& j! `   ! Z( c9 L" Q* |
  Ping statistics for 192.168.1.21: / m0 x# G! f$ A0 I3 Z4 A  Q
   * [' b9 [+ L. a" u
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 9 E1 M9 t8 p2 a( q
   3 L7 c( Z/ G. ~  W5 P
  Minimum = 0ms, Maximum = 0ms, Average = 0ms , D& t9 v8 C+ [  ]. S8 \* [3 ~
   5 Z! l9 t0 |& R4 P$ a& g2 X
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 2 c( b6 a& x4 t& M1 e+ @8 u! S( G
   7 O& S% z: e  y: R0 C! O& S: b
  -n count Number of echo requests to send.
- J5 j8 \- M& r   4 G4 T8 Z& h) t6 v, t
  发送count指定的Echo数据包数。
6 u5 v% v3 H( t4 C3 n   1 \* y4 ~3 t- v  F  M
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 2 U( U" K% ^- j
   & m7 k$ z% g! ^& c9 _& C! \
  C:\>ping -n 50 202.103.96.68
/ z; N; c7 M4 w" ?% p  
7 ?4 `: D$ }7 {. _; i  Pinging 202.103.96.68 with 32 bytes of data:
+ k8 L* B, P6 b) R/ \7 ^  
6 r/ V# Z  }; F3 \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 m" n" o- E0 m2 ~' T8 q   ; m* H/ t7 n% }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 h1 a7 Y" Z# I. x, b   9 e  m* G3 F& Q8 J: @% D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - _3 [; x5 X, p, Z4 R
  
0 V6 z, U: u! P1 _) A" i  Request timed out.
* E$ x. E* Q" ^1 H0 t  
4 b0 q- c3 F, J8 K. u0 d3 F  ………………
. h, k2 w: |' ]2 {- V, H   7 `! s  E. h: d/ r% H( ?8 Q3 m7 l
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; Q: z. N: h; ?6 L$ T. w& ~
   - i7 x9 U$ j: W/ q" @
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % {7 t0 s9 h# N' |) I
  
% h8 G6 x1 ^% H% y& K) k  Ping statistics for 202.103.96.68: " Y# T5 \5 M0 C7 L5 d
   8 s# Z- T4 C1 i; B% V
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
, {& u- L. `4 H3 N6 M0 Y! `. q   $ N) H- |4 M& k% R$ b
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
. n- h! ~- Q* a/ a( h) d   2 m. a, ]! l6 C3 l
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
" f' m( }0 n, `% b3 K  
0 U6 Y0 ~# X/ ?8 x* u' M  -l size Send buffer size.
0 b' ^9 _& a9 g# j5 g  
! B0 n' [' M; P/ Z* G, j( |  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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