返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 / @, [5 z3 o7 C5 p' l6 U2 d
   ' M+ V' s5 ]2 W) v. H1 z
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
6 ]3 i/ p- a0 t" o! b9 v  
- a0 K4 K6 d" T5 r  p, S9 d  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
/ z6 {1 C% T  E! n$ z% m  f2 H  
" x  L( S) h$ n/ q; N  Options:
$ \% C3 l8 G" p# F7 H- I& P" s  
1 h* H/ f. f  f' }3 h- p, j  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
( [' U6 o) ^% R$ v# A0 j   2 L5 b# B7 A; x2 t" V. s
  不停的ping地方主机,直到你按下Control-C。
4 g0 _5 x. m: k/ Y  
' E% ]' _7 z8 j" v  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
' g; c9 D7 Q. f! q   : B" m# H: x" N0 A, s
  -a Resolve addresses to hostnames. % Z1 l+ _  c( ?2 O
   9 t; U1 O9 M9 i4 ]8 V+ Z1 s* C' M4 D
  解析计算机NetBios名。 ! }9 G, i0 O, ]: v; G
  
) d! V) N; k8 `( o/ [" H  示例:C:\>ping -a 192.168.1.21
4 H/ q* C( Z% a) H1 u  
4 w, V" p# W5 t  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
4 N- U3 {' O; U4 d5 A7 N  
  f- A* [( V) ]# ~- c4 z5 j- B9 @  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 B, ^4 ?" m5 O$ a  Z( y6 u
   ( e5 e+ D0 g! j  k, N# x5 X
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' h$ P! L; a# U6 m, `   6 C8 b: G( H  `! I- }
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + l# @4 X# Z/ _& Z4 E& G. m

3 d: `8 U$ X2 I$ E9 `0 b  
8 r/ Q. b& c+ z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 Z* p9 t- s% t& ]3 Z- `
  
! K/ K3 m9 G& \1 F  Ping statistics for 192.168.1.21:
/ x5 S1 X2 n8 F   2 F- u) V  V. ~0 T& K7 S
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:   t$ |: O, r" J, W, z. k4 @4 v0 u" E# ~
  
$ y) C( H5 ]5 Y3 S- n; m4 W  Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 r  x+ {& g% n8 N4 T  v1 x
  
5 A/ m) V+ S; v2 n/ y( \6 S  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
3 T* {, {/ [. B2 N6 N, ~. P  
# D$ Y/ y" i6 l/ I) n8 H  -n count Number of echo requests to send. " R. x& w0 Y( _2 w2 n* q" K
  
! A/ [7 `; y( a5 i# Z+ v  发送count指定的Echo数据包数。
0 G0 a1 P* N9 W1 n3 k  
( V" L2 ]8 o8 I: b" H$ S  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: : j8 c1 `" R5 J& A' m
   - T* y5 h9 a1 p5 @; a
  C:\>ping -n 50 202.103.96.68 7 L# b% K( z' ]( `% Z: i' r/ P+ V" U
   ' V% I0 \7 M2 g/ w
  Pinging 202.103.96.68 with 32 bytes of data:
, x2 T0 t# a" s6 n7 `0 D  
0 T' U& H6 Q. e, P' W' q4 [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 R/ z  D* g% @) F  
- G" o: n! R8 V2 @7 G$ g) ?) c+ _8 }  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' Z3 U0 v1 x; `- ~, O" X: b
  
* M$ m: M. s2 c) f( [' v' c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" j% ]! F- w# X, X   & D1 N& J6 W0 \4 w+ D3 n6 ?
  Request timed out. 9 U" ?, Y# q/ Q* j& \1 d: C- d
  
3 a5 u7 d& u$ U- e. j1 `' k  ………………   x8 y6 b6 F2 P
   ( s9 H0 l8 T; ?' ~% K! E
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : X7 J9 @# K$ `) j! Z
  
9 H- e! \) g  x8 g$ C) N  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* w' t" C' k  t' k0 T! f   ! @1 M7 |/ {8 m4 Y9 D; v( K
  Ping statistics for 202.103.96.68: ! ]4 S) s5 s/ v" h! C
   + O( J6 _/ I9 K: o, D8 N  E
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
0 q5 R2 g2 i4 N" x0 D   - S* _; U6 V5 }% Q' a& H4 j
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
; j, B( W0 C5 D) U  
4 p' W* P1 e$ b; `  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
7 X' s7 |* N" v  
$ }/ P) N$ J9 y) D  -l size Send buffer size. 6 \5 S+ a, K1 X
  
2 @% e9 u; G" B$ [# L1 G' l  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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