返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 " @1 d9 i3 \0 S4 p/ T$ x! Z
   * ?: ?& `* s' t4 E8 H8 O
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
& P, w* ^$ M1 I5 O  
% S, X" }2 N  e1 V2 f  C  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
) J' i! G: ^8 G  R' L4 |2 E  
; X4 f) y$ S. n+ Z8 T0 s! L  Options: 3 {9 \' b& O3 z& ^2 w
  
: M: Y8 n6 l; o  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
" \" @- G& N% X' u8 }  
8 N% q, N8 }1 ~, f# L  不停的ping地方主机,直到你按下Control-C。
+ \$ ?& A/ C1 N, D# x* C4 p   ( n& b9 A. e: U: }) V$ @# l
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
' v: g3 b$ s  B1 P! j% u0 c% x" T   $ x' I  ^* U2 O' X8 b
  -a Resolve addresses to hostnames.
) Y: x# W% U2 e$ l8 x. c/ t# \   0 O1 m' \: i3 }5 S
  解析计算机NetBios名。 9 W: s1 h9 {. p5 |; r
  
7 J4 S( u9 ^" V- N" y  示例:C:\>ping -a 192.168.1.21 % k. n. M, p" M" X. i" f/ m
   % U2 E3 ]  s, ~: D
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
$ M3 A) w) x& t9 A( [' {. g) T7 j   ' T8 S7 j! X& V8 m  }
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ C7 y' R- w  P% o  
: C! t# D  t& V* ^% P2 S' S  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% ]1 N2 P6 k9 q, s  
) h& X, ^& s; [( {. n- J  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : k0 j' R4 T7 ?6 A

0 r0 g$ e8 c5 w* Q$ ]  r; W  
9 o0 ~- w- @# T3 m2 q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 a# ?6 n3 @/ @9 J/ d$ h  O   , z2 p9 g5 U, D% c+ @, Q
  Ping statistics for 192.168.1.21:
. E5 k: G, L: e, |  
# H. b* s( }* A5 d  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: , _: R, n& H( z' f* \! s
  
4 j; Y/ ~4 Z& S! ^# M0 G# J  Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 Q+ H$ H* y; q8 {% v  D! j! C
   ! k" G+ h( c. y+ `" ^* Y2 W& o
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ; s; a9 {- R$ S5 v( z9 s* d! A
  
  s% ?7 u$ l  w  [, U; k  -n count Number of echo requests to send.
" l/ ~# i9 z' _' s3 r  
# x, R) \+ U- @  发送count指定的Echo数据包数。 ( N) X2 ^2 Y  K, D, x, B% x
  
  M; k2 @8 w4 K( J- w0 A0 p  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: - e+ r4 w' E2 h2 X0 C
  
9 t% E$ a5 I* G4 `  C:\>ping -n 50 202.103.96.68 , a8 n1 u0 t3 b4 ~- H- M1 p
  
" S) r0 o" E+ O) a  X* M3 {1 e  Pinging 202.103.96.68 with 32 bytes of data:
2 A) W: T+ p, d  
+ _7 n: z: r, T1 M& L6 u  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 u) c8 J7 B+ w! a! E   2 c1 d  j+ G+ c! C0 k; U, g
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- F7 t% ?2 W6 \  |$ g: d' Y! x   ( _7 b2 x* a/ Y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " J+ |+ h1 U' Z& f3 D7 ^2 O
   % w" a) h& M* a4 E+ Q, |- I
  Request timed out. : c* s: Y1 P/ P1 K) T9 o, H- K# D
   ' k* U' \( ?1 k8 E( [1 E% H% B
  ……………… ' c) k+ T: K* l; {6 b6 [
  
2 M: i- g; ~+ p3 m, p2 q6 Z+ P& k  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( k. ?5 G; r) V, ?# S4 S+ P) o  
3 `, |- E2 m8 M# R  A! ?8 `: h  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 k' R% L8 j4 F3 _& i  
5 A' F2 V- s/ T9 l1 i1 M, |4 r  Ping statistics for 202.103.96.68: 8 J1 k) a; I( ^
  
1 {6 r- t) N/ U9 c/ c+ c  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
6 q4 M8 q" O6 d5 o( `) T! f  
7 f( {+ g1 Z& e7 b, b$ r  Minimum = 40ms, Maximum = 51ms, Average = 46ms
+ c9 R# A1 E# W' T  
& u& E1 L* d+ b# T3 x  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 4 e4 O) {% |' |) y- y. D
   1 b: @8 x9 j8 V1 y% ]
  -l size Send buffer size.
4 ~! I& t# ~1 V& G   1 Q9 H$ K- u1 a, U$ W; \2 y8 M
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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