返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 6 L5 f! y; m) X& j) H9 k3 ~
  
' v6 k& U; b" P  @5 {  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:   X7 l+ p  L( r
  
0 B! o" b& D. G9 _  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
/ G. v* I1 x- o. o  
' n1 `4 Z. |& s) e" D" h  Options:
6 k- o1 f: L, {- x  
" z3 a  T7 L9 z# L: [  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. $ c) B! e/ r9 Z0 c% e; E! K9 c
   % ~6 \/ ?% n2 U/ l8 n" J3 K& F& l
  不停的ping地方主机,直到你按下Control-C。 9 ^$ Z8 |: n6 ]' Y' ]
   ! {5 J: X% O4 e: u0 R5 S
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 ?+ u% n0 b( s0 Y8 M
  
. L/ }/ W! R1 `2 }, T# R4 _( ?0 I1 y  -a Resolve addresses to hostnames.
7 `5 p1 u8 [) ~  ]1 ]/ @; F/ u; r  
3 w, K( e2 k! Z. _/ p, v8 W# t  解析计算机NetBios名。
. d; O- d  P# t9 `( P+ r+ u  
- I7 I3 Y9 `& ~5 d! Y: W+ f* w2 E( f  示例:C:\>ping -a 192.168.1.21 0 p& z3 W1 k% Z) I) X+ D; q
  
( I" x/ l" y" i- @  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
6 }- }) A3 D" a* t9 E0 o   - R  z3 ]+ `: a4 D- ]# ]
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: \8 B) M  f/ w  M- U   ! J* Y0 e8 r5 ^4 I% l8 l" q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * f8 O3 l. T1 w
   " p0 G3 \) ~) X  H6 N/ k/ f/ ^% w0 `
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! Q+ b9 j- L( A6 w; e
1 R( `' [- I6 Q: D  ]  
* v& h2 s; h2 V; s7 [% T' v  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: ]; n  M6 Z" X' `  
9 P6 I4 s! F! v  m( s  Ping statistics for 192.168.1.21:
8 d9 r) I9 P. E4 n* |  
$ |' e% }0 F. Z$ E$ c* `; V  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ) P4 a( o6 C0 a2 l- {
  
$ N3 x  l! {  ^$ f& w  Minimum = 0ms, Maximum = 0ms, Average = 0ms ! Q) s* I4 q! f
   2 G; D3 |0 ?0 {) d: A
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 8 G* t: m. e5 q( K
  
: C  T# b4 Q% \3 B* c! V' t  -n count Number of echo requests to send. 4 Z2 f  Q3 q, v
  
. b1 X# Q) Y9 X, j! j1 p3 H5 H  发送count指定的Echo数据包数。
( R# n0 r' v/ H! S4 u" C* ]   / U9 p  o3 `  g# z1 b) a
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
* ^2 L* S5 Q7 Z4 R/ y" `* }   ; |5 l8 B' f4 z5 P1 M
  C:\>ping -n 50 202.103.96.68
) F6 v; Q9 y: ~# A. U  
$ f0 D# q" Y* k  Pinging 202.103.96.68 with 32 bytes of data:
- {! ]: Z+ }, w) l6 a* Y   : L* Q$ J) h% w2 B7 Q5 e2 R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   b- J! e7 M9 I5 C% W5 X3 y
  
+ d( g  f  W4 d4 c6 p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 V% M  P2 P; T5 f
  
  r3 }7 j7 z2 ?8 O) y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 z/ d+ u( t. W' Y: `& A/ n
   3 E4 U- b$ u- l4 p2 ~) c
  Request timed out. : E$ E( G/ J9 e5 J3 K
  
5 t- T0 E" \5 ~, p8 i1 Z$ G* P8 U  ……………… , v3 M" g9 ^0 ^$ b
   0 M% F' t! U; Q1 l* Y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " k& I* V* q, ^# H) c3 h. e5 H
  
" x2 e( F/ _' N9 E: }. d& k  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . {- _7 V$ T, o+ ?' A4 C
   ( a# A( k- Z. t7 a. Y# C
  Ping statistics for 202.103.96.68: - H9 _8 m+ d2 K6 @; \0 K
  
! N* F; c) C# Y  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ( o) \8 m6 S* i: _
  
4 L. m! N/ [( Z8 T$ d% S' q' r  Minimum = 40ms, Maximum = 51ms, Average = 46ms
4 y4 v* A! U3 {3 W8 h7 R% p5 }   4 X: x+ z+ t5 H
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
+ B( K  Z+ T/ Z' Z% v  
# c- K; E: M3 T$ x/ V. r  -l size Send buffer size. 1 ~' Q# R. O0 j, i
   ( i( O0 I6 S$ c; W6 y8 U6 L  h0 U9 Z
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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