返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 8 s& v; U+ i  l; h. M3 c0 D6 a
   - K+ I7 s& r1 ^, U9 i
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: " x% v- X. w0 x
   . x0 c+ n& T; D8 m! B( _
  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 J" c! z, i4 ?  
. V% y5 Q/ s; `$ c  X  Options:
  L# }- }' M+ w# p' G7 j7 d) p  
; u; s+ J5 {. K$ A1 _  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 4 u3 P' C8 {2 o& c+ w
   , u$ S) `$ ]& _6 y, B
  不停的ping地方主机,直到你按下Control-C。 " I) t5 E5 C! T; F4 R1 K1 b9 V' Y
  
4 W# z/ M: b: }! k- k' K  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
( t# J* b* o- t8 X5 H, E   ( A& ?! z+ X. p+ p% m8 `% }: y0 {
  -a Resolve addresses to hostnames. # B0 L: M8 G# L# N  [
   ) P9 }  _9 K  t, p4 H9 c" ~0 ]! ]& p
  解析计算机NetBios名。
6 K. l! k6 G4 A. ^' E   ! {, e1 t3 x) K5 [
  示例:C:\>ping -a 192.168.1.21 : G- a' u6 J7 |; m- H( [
  
, A5 K& ^/ t+ S% y) i1 B  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 v( N5 r# ~# W6 C2 ]! ]- ~5 @  
& K/ d" c9 O& R" \' Y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 Z- Q* O$ V+ C+ M1 p
   ! ^2 s2 C- n5 V- m; I
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) k# T7 {" E& W  
1 }: n1 n7 Y. f* R- D  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 g  H7 e  g6 `0 I* c
# i! F7 J3 _9 e* r& k. g' }
  
5 a3 e; ]# r- W  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, j  `8 g$ c/ t) v3 `   * A) d. s$ ~9 L( `# n7 |( F! @
  Ping statistics for 192.168.1.21:
! L* I2 L$ p+ |0 N: F9 g. N: Y: ]# e   ) o3 t9 G9 b+ I8 B: J2 r3 k
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: . @! K% z0 ^+ @% m( O( D; b
   2 c3 G6 r0 c+ h6 f1 `
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 3 u$ J: J9 c6 z* S( ^5 D. D
   : B; w6 e3 w- q, d+ i7 Z' X
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
, }6 F3 j5 P) X6 S' t- h   + j% j9 z$ }% T9 J1 I2 Z& D
  -n count Number of echo requests to send.
0 \2 |) ]8 D! f  
4 q8 _# D$ h9 q$ E  发送count指定的Echo数据包数。
/ _  r2 u  h" K   5 \# }- ^  R9 E2 M$ C$ W$ _7 {
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
$ \; k( f: ~% \7 P% g$ D( \   8 e* C" V, x1 }
  C:\>ping -n 50 202.103.96.68
$ K( `7 k8 a& E5 }  y7 e& |   2 I1 m/ F: Z4 x9 Z" J5 M- k' d
  Pinging 202.103.96.68 with 32 bytes of data: - B5 z5 `  G" S. f8 b( h0 l
  
$ P3 l" \2 q7 e8 z4 r7 X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& S" ?: i8 M0 R3 Q4 T  
# w9 b( G" m- V2 ^& m+ E' J  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / m1 z! M$ g7 z" U* w2 {
   - a8 W: X. G+ A/ U
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ J! e! Q- ]* d" b
  
6 T" N% W7 ]* U, D" T  Request timed out.   W1 V" g, ?( O0 R0 j
  
( F2 V) g( Y- `/ v; ?% T, r; z  ……………… ) O$ T) d+ W/ F# Z- C2 _: Q1 u
   ) z5 X) l& n# y7 ~' M* f$ z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) H9 l2 d4 j/ P1 z- E/ x
   4 D' x+ O1 Y' F. P6 A8 P1 y; e, K0 b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. f6 j1 L$ z% L6 c) C; _; r3 `  
9 W7 i+ z4 d% w  Ping statistics for 202.103.96.68:
6 v5 y# [3 ^' h   8 z3 P; U; S% d* W. b, f
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: - l5 x: v/ P9 o1 w; t- n! l( D" g
  
  R" h7 ?4 r; P7 k; e* ?; ~' N  Minimum = 40ms, Maximum = 51ms, Average = 46ms
3 R1 Q' t" ~8 j  
/ X; C0 t, ^& l; {8 {! b) W  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
, O8 p2 H) R$ ?$ K   " |; c' t" M3 ^0 [3 ?0 H
  -l size Send buffer size.
; z4 U: q) S9 @; A1 u  
  M, J/ M# f! l4 l8 g2 a  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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