返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 7 b* `* C2 P/ n
   : U3 t7 h) ^$ c- R
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ( T' Q8 ?2 h0 Y+ B# ^9 s9 `  b
  
  h% Z2 v& \4 y9 m  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 1 y- E% w9 V) M8 R. ?4 ?; r1 Z( O
   " \+ G, z. w7 q- I2 a
  Options:
8 x  c& c; H& S# M3 o  
! I- y9 t& `1 _/ G9 o  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 1 C$ L1 E: n+ Q- z3 |% C1 [% {
  
6 [  s1 r2 A: `( ?3 I  不停的ping地方主机,直到你按下Control-C。
7 P5 S$ K; n, r0 n$ y4 Q5 ]% c  
$ [: q) G: @" z! ?- L2 k  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 3 R9 ?# }' r4 @
  
0 ]# N/ p, @5 Y3 y  -a Resolve addresses to hostnames.
  C6 C1 ^- j" h' h+ V! f  
$ v& A' ?, M8 v  Z+ K9 `5 M3 {  解析计算机NetBios名。 * P& Q1 L, s, O4 E) c& G
  
, U: J# K' x, X" V4 X  示例:C:\>ping -a 192.168.1.21
/ O: S0 x/ v0 \- r     m; j3 Y- L+ k8 p- ]2 n7 q
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , a, y. Q5 \, X9 G- t# I5 J4 ~
  
& N3 r0 l  X! O: b/ d9 s) j  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + O* T$ K1 x& H2 G8 u: A+ f+ i
   . @4 W6 k6 V- C5 e2 F& ]0 A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' S% ~3 e" t$ v& [+ L
     h9 B6 t$ a7 ^' V
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 `7 m' {- w' y' I- @

4 z' B) g) _1 v# D   7 D$ H) L/ [! e' D. i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! S( ^- f; a2 _5 J' v6 {' V0 h   - }3 X/ c9 @* w  n4 t" L* p( Q
  Ping statistics for 192.168.1.21:
, O# e# H% c3 w3 h2 J5 @$ o- k  
2 s/ a5 d# m" H: j  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
, y! ~0 g" W: X* _# B  
# t) s% j6 J# B' \$ }6 D5 w6 ^9 I  Minimum = 0ms, Maximum = 0ms, Average = 0ms + K: O) u4 M, A( M
  
; ]* e& j3 f3 @& g% B! N* N$ \  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
$ p; B* \5 X( ~2 y7 q   ; v+ h* ^& p' L6 f
  -n count Number of echo requests to send.
0 q- C- a) m. G  
  A! {7 \; H& F( t/ I2 C8 J; a  发送count指定的Echo数据包数。 : A5 B$ Q7 Y3 H! O# I
   1 Q4 R% ?8 S+ J0 D
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
5 N0 K7 e$ g  _- u" Z# r" c: f- t   ! A! }, \/ H& ^) z8 i
  C:\>ping -n 50 202.103.96.68 - S  E" t( M  ?$ b7 a3 g. D
  
, h) p8 L! h; P' P5 x; [  b, _  Pinging 202.103.96.68 with 32 bytes of data: / J' y& @: `, x: [1 b
   9 \2 h, y9 K, W" t* b7 e8 |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . ]3 ^4 ]; k- ^& w9 y# q
   9 n3 [1 H' _! |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - q' f- G# {5 D2 F3 y: N
   . `8 ]( i0 q% T, Z! |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 N$ j3 [, M: t  [, b' N8 f+ a
  
  D' ^  W1 D4 u. n, L  Request timed out. - U' w* I6 _/ A. l2 G9 J
   ; F( J+ D6 r6 w& a
  ……………… 5 W% f0 ]" C; T# y& S3 P* t, J
   2 U# t- {1 Q/ U9 P- S' |% I# e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( J( e; q6 D5 i# o  L$ v   - H+ l3 J& L2 }: f9 a
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 d0 u0 x$ n- S3 m$ X   4 u% y, ?$ \) _" r. b5 w# Q
  Ping statistics for 202.103.96.68: " N7 |9 t0 B8 _3 w
  
" o  D# p7 A( {1 h9 O7 M* b3 `  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
/ X. ]% [! C% }0 f$ f7 K  
* H8 k' O& s0 Q8 }6 d) c- b  e  Minimum = 40ms, Maximum = 51ms, Average = 46ms . \) h% K" B/ K$ R% r  t5 a/ Q
  
2 r' c  m4 v$ |  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 w7 [! k9 @4 X- A  ~6 Z" ~
   ' T# N! s5 X! F
  -l size Send buffer size. ; G  Q1 y3 B5 ?0 U) o3 q
   # m# B1 H$ Z4 H5 b, I
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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