返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 " X! \/ I$ J& K1 v# N
  
# D6 H" a$ k( f" {* l! ]  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: : _4 n9 E3 ?- S! \2 w
   7 D9 r8 S# d1 i: B  O: Q2 [" Q
  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 5 M+ [4 v) z' q3 d6 o
   + J9 Y, N, C% g+ P& u& I% ]
  Options: 2 f  L9 w7 H9 o/ K
  
# t+ @) l& R" K# X% Y' O  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
! b; M9 G$ n& T8 s7 R   5 P. v+ G* r$ R* g2 A0 j* b
  不停的ping地方主机,直到你按下Control-C。
: I; J! t- G' {& W$ S8 i  
3 X6 \9 e" L7 _4 f% m  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 : E& {4 h* P1 T0 G* E5 \
  
9 n/ g6 P0 m+ @+ L* T  -a Resolve addresses to hostnames.
5 c" `# l7 a. e9 ~" `  
+ ?+ d& L/ I. f+ _' g  解析计算机NetBios名。
- q0 ?+ R5 A1 |+ L  
- d8 d2 z. g; i  示例:C:\>ping -a 192.168.1.21 3 U" y, Y4 m3 x! y9 q1 ?& S
  
& j% y) F0 e. V4 _' P" F. {4 e  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
/ M+ q+ h4 L( D   2 O  ^7 J( L- a0 m/ L
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : Y" v4 i' A4 H" h+ |  D
   % s4 \  g, i- u0 R3 n
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; {9 f( ~7 O: p" ?' c' I0 O  
, ?# a; }$ Z7 s  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) e$ C7 F3 a! u7 e* ~/ H
" u) h" ^! F& p7 o- h" e
   8 K4 m* j( r" ?) ?! ]
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 P) D* a' x; l0 i* _7 o8 t% J% h9 c  
/ P0 o) \+ w. E8 y0 w  Ping statistics for 192.168.1.21:
" ~# e; C" W5 D  A8 s   9 o2 \: }, c) w7 J1 u! n+ O) a2 o
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
; x, y# k3 E% T, \0 s, G: q: o  
3 ~* m2 c5 }$ d. ~- N5 P: o  Minimum = 0ms, Maximum = 0ms, Average = 0ms
( \) ~4 y: O5 _1 s: u  
+ D8 f9 l. d) D1 ~% v  K  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
$ D5 |, q) r5 v. E* q  
: I8 b1 I, o& ]# W  x  -n count Number of echo requests to send. * w% }3 L: ^" b( S) n# y
  
3 \  t" x. W" G( L; h0 w  发送count指定的Echo数据包数。   k7 E2 I# {: K" j, D6 K1 d( z
  
' _( `1 Y* x: `4 J) ~- T& u  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: / e6 {# M0 s, p  u  \- z
   8 b" V/ d5 [) V* k# E) P
  C:\>ping -n 50 202.103.96.68 4 o" a4 `7 L: [6 u# a
  
1 G' ~0 R3 C/ h  z: }  i( d$ ~  Pinging 202.103.96.68 with 32 bytes of data: 9 u7 T1 S% j/ g
  
8 |6 J* B3 M( o  O$ x4 M5 O  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - N  p3 L& Y8 |, _" v% \/ r
  
# I4 {7 C, s0 _6 G- i0 d  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. X) M6 N" R4 \9 _4 Y3 V  
/ @" {4 d1 B- f7 u$ V8 c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* J" Q6 @, J8 j" R9 f  
; x3 e6 r$ B% H0 s% x  Request timed out. : g# q( `  F( y' g
  
- J7 R# m: A- e  ?  ……………… : a! j5 z+ W1 |2 L, h) F% f& T7 ]' G
   , p; [  \# i0 Z2 B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; ]6 n, F0 V- Z9 X* h   1 x" m. |& b. p1 b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! ^6 o" P4 u& O* E+ T6 B   1 w; I) q) ?( C! S3 A" @9 i6 s& e
  Ping statistics for 202.103.96.68: & z/ O7 w( u6 K" Y9 [) _
   - h7 N" y7 x8 A/ U9 K; _$ s
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
; ]" H5 z. M& }4 }  
" |1 R  p9 o' M1 m+ t3 G, C  Minimum = 40ms, Maximum = 51ms, Average = 46ms 4 G% d' _% t0 B! i+ q0 [$ Z
   ) h# v+ F0 s3 X' M4 S
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- K  b2 m. S( m6 q$ L   . r  w* \/ K) R, V& J
  -l size Send buffer size. & [6 s/ ]! w. _: A9 E' G+ I
  
& b6 B, r) }* W0 o) f. C: r8 d  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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