返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
5 e* J- i: o+ {5 ~2 t, d8 f2 a/ z) T; t2 e  
" J/ N6 j+ Z& Y3 c, s9 e  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
7 p  w6 {$ m& n! y! p  
" A) F$ y$ D. e7 J' u1 j  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 3 J9 \  w5 M7 K3 ^
  
% _: B( C# L9 j! N1 ^  Options: ; P, Z$ Q! W) p% \' \; ^% u3 P
  
8 Y" w' l3 O; x3 N) Q$ @  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 8 E, w4 |$ {, c+ P: Z  ^. x
  
4 w: h. h6 Y) J. x- c9 I5 e: f  不停的ping地方主机,直到你按下Control-C。
  ]* Y  x$ n" Y% \& o" {  
& K2 I5 I9 \6 X1 x  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " B0 B! e# I& K* g0 I+ z" a6 P1 K
   1 T; O& Y2 ]" O
  -a Resolve addresses to hostnames.
& l  p# g- p1 d4 |* a   8 D+ |5 H6 b5 v% K
  解析计算机NetBios名。
9 L8 R0 T, F5 G( ?. B  
0 H1 }: V* n, P. p! L  示例:C:\>ping -a 192.168.1.21
! s( V0 X' ~; Q3 m9 }. S" |1 k     F. u5 u. A- N% ?" r
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ! S; ]0 Z' O' L( ~  H0 ]
  
9 n3 H# z4 }0 f) p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, u* O, Z+ [8 J1 K  B$ M6 i. \7 [  
1 U& D# S9 [4 G. _% p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) r) q7 }4 a+ d$ c- O   % R% ?( O( ^" e$ I& j. b& U' B
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, Y& J/ s+ [3 M. `' f) T& _3 c3 P0 O$ s0 j4 N* T, I% h
  
  r3 w2 Y2 T% t( Y( x/ `7 A  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) @  N+ o2 C; n' U& Z- I  
3 s6 B9 ^* e0 A/ w  L5 d$ J  Ping statistics for 192.168.1.21: / }2 w8 G6 P: J  o/ `
   5 l- @* h; m& r* J. |! D( |* M% f
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 0 G$ Z% I- p9 T# S( v/ L
  
; {3 g$ J% ]4 f9 @% T  Minimum = 0ms, Maximum = 0ms, Average = 0ms
9 ]' f) E% {$ ?2 r5 x; F   ; l% O5 e% l8 v9 {! [5 L
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 + y  s" Z& I6 L5 I
  
3 S2 s" x1 V/ P6 l4 Z2 B: @  -n count Number of echo requests to send. 4 g0 u( u; k# l7 V/ ^
   5 ~( e% C' O, j" W4 f9 R) I
  发送count指定的Echo数据包数。 " E2 O6 A8 n8 q. ~
  
/ H+ S6 ^+ s/ d- G& b8 u  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
& c6 B7 Z) Y, A8 A  Q; m1 C& ?  
) m5 D  N8 S' p; e7 F  C:\>ping -n 50 202.103.96.68 : B3 g8 _& o) [1 F: Z3 g# W
  
- }1 c- Y! `7 U) R; `! _$ O  Pinging 202.103.96.68 with 32 bytes of data: ) @; |" O8 M3 d6 F$ F
   ' C+ Y6 R3 S6 E9 _
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! G$ ]* m& H  B& B) `2 C+ Q  
  [- Y( o( w/ d" {  w  Z. n6 I* C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 c; R+ s& J# F( l
  
0 W- b3 e3 X; e$ B0 `& h  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' J: W! M' a# r; m! N6 T3 ~
  
1 o* J* d2 H  S- Q  Request timed out.
: m  e4 ?( |" Y0 _; G, B; Z   3 x; N' }; c0 R% f, t8 F: O
  ………………
; {' L$ ?: k0 \" A  W* [' u2 T) ?   5 {) T; E( D: w  y$ |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* j5 V4 j4 v! X4 |* v4 ]; x  
) b) e* P# ^- {7 D/ t3 l3 |2 c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 h! B" `; b. s  Q8 D0 y
  
% `! O7 u( q7 ^! c7 i2 P6 a  Ping statistics for 202.103.96.68: + B- [! i$ c) @7 Q
   , Y, a8 X) z9 O/ ?' u) I( ?* c
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
: H, i8 P0 A+ a- u8 m  m   ) n% a4 X9 W% Z3 I. k8 O% M
  Minimum = 40ms, Maximum = 51ms, Average = 46ms - |% M. f8 Z% q- f. H4 G. V
   7 F8 @/ ^& T" D  r4 T
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ) E$ s! W- p2 r. k& O7 s
  
; z% i$ w& l7 n# z# I6 V! M  -l size Send buffer size.
( F! y" x, `( J% ]$ G   5 a2 m: e/ M" b/ F
  定义echo数据包大小。
89w.org捌玖网络

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