返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ) p; T0 z% r9 O. N  _* X% V
   3 g/ D4 w# g4 C% [6 Y7 L& H
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 2 D( X# D3 D( `$ k" n
  
7 L- `$ }( O4 i  i+ t  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
$ k3 t$ F8 z, A" k8 w$ s   ! J1 U+ r; A" e. p8 C1 z# {
  Options: 1 x4 ^4 T- u. T) K+ n7 q" g+ K
  
0 _/ C- c0 \, G$ z( [5 `4 J  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 0 X9 K! f' u+ y  q" \0 ~
   0 ~0 `+ v4 @" V# y# j  o' D- o2 K9 n* M
  不停的ping地方主机,直到你按下Control-C。
( r  \6 j- J3 K3 M  
6 W, [, I4 S  K  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 % d6 t) O& q+ P% `
   1 m5 V5 s; n3 r/ @# y+ o# d4 K5 D# v
  -a Resolve addresses to hostnames.
5 z! c5 T- O6 u) n   $ z. `) \- `' h4 `" d! a
  解析计算机NetBios名。
3 c4 w* z- r2 C- b0 j  
; I; g7 g5 `" c! B" N% |  示例:C:\>ping -a 192.168.1.21
7 d" m- n) H" L: |2 \, a  
8 y$ T5 E3 k; v6 l; L8 m3 c- d  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: / i/ f+ b# W8 Y7 R* l
  
1 M+ U) `% N% h/ M) w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , I7 s6 ?  r0 c& n2 Q) G
   - ^7 H9 V3 d0 g3 J5 u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) ]- N* i( Y$ g) I; C# g
     V  O9 a9 U7 X
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  F* }) p2 Z, P7 Q) s# X% a
# D3 j) s% m: h! @0 v  
+ Y# F* E' y8 n6 b# I0 W8 a  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 l4 w3 f, T2 e/ ?+ N. s
  
3 @5 f6 E( s% e; J& V& S2 K  Ping statistics for 192.168.1.21:
! n4 B# I  g: R! l# U2 S  
" m( [: G* I. O7 z' m) e8 W  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:   l, S/ c3 y$ t$ J" w' c" P
   . g! F" B( ]# J
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
% s! ~; x$ t* g0 d  
/ `: M0 Y" z% B* p& Y  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
& t* s/ A: J/ k1 F% K  
# k5 L2 ^) W& L9 C  -n count Number of echo requests to send. 4 f* _( H6 s* J- A/ f
   / t  M" ^$ }# [6 I" S9 j# j
  发送count指定的Echo数据包数。 ' {+ ~) R* Y7 X$ i& N( ^
  
" B1 Z- ?7 O, Z5 E3 `- `  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: : v$ x/ S# D# c: W8 ]8 t4 O0 F
  
, z( l- G0 g) }* {% X) Y  C:\>ping -n 50 202.103.96.68
' o! L2 \4 L: w: I8 \8 T5 B* I  
9 u' Q/ Q5 K4 P, I/ D) P; v0 ^  Pinging 202.103.96.68 with 32 bytes of data: 5 A6 L4 |! l- F
  
9 Z# r6 Q+ `6 o6 T5 @8 i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ }# X2 ?# o8 S0 ^5 A6 D  
7 {# j( U. s: e2 O  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! W( x1 i3 T' L3 X" X5 _( p# @1 Z, @
   & j; e* B' B- g, J5 L& t; w
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 m6 {; `& H0 b* p+ M$ r' D. w  
* D( w  t( m4 V, o  Request timed out. ; I. }8 y5 o6 k5 O5 C- Y" n
  
4 u* w6 m+ w1 ?( w) [" v+ ]  ……………… ! n6 U+ T  P0 |, `% y
  
  ^3 z0 ]2 @( b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 r, L/ U) Z% k
  
: Y7 r" x1 J( I( O  ^, Q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ ^: O+ p: A/ O/ R6 K# e1 X   7 U, H# u. L, i) N3 ?
  Ping statistics for 202.103.96.68:
$ B) c& C* p* h% j  d$ ?$ x  
+ S$ `% S  F6 v. Y% C2 o/ y  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 1 f4 i6 i/ C2 T) M  x( ]+ {& Z
   + L8 Q4 R% u/ T( d* y/ Z
  Minimum = 40ms, Maximum = 51ms, Average = 46ms % T+ H7 R! g( h7 q/ f
  
% G, P( d0 t* _4 g. o* w7 q  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 r' [- I. l+ A6 ?( P
   ( G( t; c$ N6 N. ]* Z
  -l size Send buffer size. 1 _. @' s/ `- c! r
   - z& R, V. B# m$ `" C
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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