返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。   J9 s( ^5 L- }) i% p: b
  
7 g# a2 L. y7 I0 X! [  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:   R9 Q1 P4 S% I7 N$ x( j
   : W/ W$ ]/ T/ q9 c, L& z7 [- \. D* 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
  D3 x) q( H0 Y" D8 n+ B% ~6 j   & b" E7 ?7 h: A# o
  Options: - l4 [1 z$ Y3 h: K
   + r- c8 Y. F# q4 O  ^7 t0 t- a
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( v5 j/ A% N/ `' o3 V
  
# O  _( W+ H* X& Q# }' {$ C3 |  不停的ping地方主机,直到你按下Control-C。
/ E+ {: L: S8 z3 Y0 J0 X  
4 j, b4 D1 H6 X. a" K  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * E. H& \0 ], @9 ^
  
2 ?7 x2 c$ s4 L. q5 |  -a Resolve addresses to hostnames. 1 ^/ k5 X$ r6 ^7 {% P1 |
   4 H5 V( a9 g8 r2 H. ]4 V5 w
  解析计算机NetBios名。
3 }* o' M# g- J3 d) m6 d& R  x# h   - m" ^  K8 \7 t
  示例:C:\>ping -a 192.168.1.21 / n% a/ g* s3 u! V, U
   7 o5 G/ ?7 O" Y$ p% n$ e9 }
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ; A: d* j+ h0 v! d
  
4 q+ X" M9 w: ^& ]& W$ V  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 o# C: d+ S6 r3 e  N9 f9 }   # k( L3 ]2 q% M2 H2 z2 ^; N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 X4 v' Y2 ~2 s3 B* q   9 U! P! w$ W: l0 l
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 s4 Q  [% r1 r; l/ f' b& m8 ~
' a, @& U6 u. {4 c) N: g
  
& R4 E: L, z/ o  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 {, N$ D( ]7 d0 _0 Z  
: L4 ?* }4 i, c1 ?1 o2 v5 ~5 U5 |  Ping statistics for 192.168.1.21: 6 L! _* O, b0 T$ g; K
  
$ Z+ J2 a& j. a% ^1 x+ {' w  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
: A4 B. F& R4 y) L8 U1 N  
' D- Z! b+ ?# }3 s  Minimum = 0ms, Maximum = 0ms, Average = 0ms
3 p+ f! H# S$ S5 F/ U   2 b+ R5 M+ ?3 j$ T9 k/ s; H! H
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
8 ]8 Y* [, `' N( Y4 R   8 o' W+ @- l2 c/ O& f3 }( V
  -n count Number of echo requests to send.
) p: D" z5 E: |7 u, v   9 N, V6 m- k/ y: J3 O0 p! I9 q
  发送count指定的Echo数据包数。 . \) ^* V- @& C5 H3 B/ M4 F# |+ i
  
: y8 x0 }/ H1 b+ A; }! P# E  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: : q0 B$ b- n4 m3 D! [- U# B, u
  
. H# G2 D  j' X: |  C:\>ping -n 50 202.103.96.68 & ^+ j  s% }1 A# y* ^) C( H
  
0 b8 f$ I% f. I! q  Pinging 202.103.96.68 with 32 bytes of data:
$ h. V( z$ [$ o# U8 s) Q     T( W. N" T& N: j/ u0 q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , }1 N8 W+ {8 l+ V! ?5 e8 N$ p
  
7 H6 v2 t- a+ M8 G; v' I9 _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 d' i# z$ t+ y! K/ g9 ~
  
/ T$ V5 |9 V: b7 I- ^+ z) y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , I" z% u8 v3 G6 d& O) f  |
   5 |" y: S, F$ ?4 `8 Z) x& N0 t) c3 |
  Request timed out.
$ h8 T8 v5 ?. o4 @  p  
' N8 K( w' F! w8 Y# a  ………………
" ~' y; i( W5 P7 ^: y   ; _+ b4 t2 n- P/ v+ c5 S4 A
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 R6 ]  w( ^! Q+ s. e
  
0 n- u1 q! N- |0 s  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 o5 G; P7 \1 Y& d4 e% B) w  
" p2 X' B2 h! P  Ping statistics for 202.103.96.68:   u/ \0 L! t- [  X9 ]: `
   1 L& C: x) k; b, h. ]) f; S
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
/ s3 H/ P8 J! @   6 ?+ s5 _2 D  f  N
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
* W* e8 y% Q% Q2 z% V+ W( x9 e. ]  
& f6 c& N; J2 Q& G  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 6 s% d$ D: O: u1 \( \
  
$ m9 m* Z( L$ v! L5 F* q. B  -l size Send buffer size.   X. l* v( z% E9 b% V) B
  
  l  c3 B* u" ]' f  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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