返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
% R) E6 _1 |# v/ g  
9 Z6 ?( p. g& d) I3 k- i  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
8 k) y3 m' a' c$ q/ U5 c  
  b" @/ N# J  E7 x. f( M  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
: A) Z8 @0 D5 y   ! q# M8 e* w% A# N! `! w: _
  Options:
+ i. I) L$ t- q( `# B4 R0 C   ; v7 B0 w! a! J" w( {
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
* t+ f5 f/ t! \8 L: c9 |* i5 K  
! p8 {0 K% b3 M5 H  不停的ping地方主机,直到你按下Control-C。 ( Z6 Q, |  z) d7 c
   $ U- H  @6 E% o7 s3 J, ]$ C
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
' \. W+ I9 Z% [, W; C2 c% C- K  
! J7 Q: h, A2 }' H9 u8 L1 }: G; A  -a Resolve addresses to hostnames.
. W' y! B( x7 P7 ]0 h" m7 Q- l9 e   + Q9 T( h. X& j+ {, X+ z: e) c- |
  解析计算机NetBios名。
2 f1 m# M! o) E9 u9 H0 U* _  
: V9 |  {3 l% a6 l- K  示例:C:\>ping -a 192.168.1.21
5 L, `. m* o& f/ t' N6 ]   3 J9 D) l# y4 p. {" ]( s( n
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
/ k$ ~4 n4 S8 f/ d  
5 H$ r2 O9 v- y6 Q  ~  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ t. w4 ]+ M% U, {+ K" Y+ R
   % Z& S# M$ V$ b  |" r! s8 ?* d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " J7 x/ L9 ?3 N: r* U  Y3 g
  
' n9 L% [9 c2 E7 W0 r6 E8 h" }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( |9 q  l- ?" D5 g
( F- j; V5 Q1 k  
0 o" H: c4 |% q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 X* K: o, V& @% X3 w
  
( w. R$ }; v$ {3 Z, y# D- R  E  Ping statistics for 192.168.1.21:
3 A+ a0 O. r0 b6 A7 K% M   : k" J% j' H0 j# o- U1 Z8 z! J
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
1 d5 @8 [0 \+ N, w  
" \# o% f- A7 a2 R9 ~" g  P, E" }  Minimum = 0ms, Maximum = 0ms, Average = 0ms * S; G2 E/ Q4 T$ R1 a+ W- C& U5 Q
  
3 k: k! \2 b: H% C  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
' I) c& z( W1 u8 D* a6 _2 E4 T  
7 D4 e! j& P( ~$ F  -n count Number of echo requests to send. : E, N9 j6 _: a9 Z6 D
   * S2 b% [; A' [  }
  发送count指定的Echo数据包数。
! O! v" |4 e8 ^0 g3 u- o  
( e8 B) c' @8 b* K3 u0 {! a6 G  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
; [- J* T! q, q9 _' Q  
  k! T% L7 r3 o+ `. L  Y# T/ Z  C:\>ping -n 50 202.103.96.68 9 c$ v* s5 y! Y; x: w- X
  
) o2 T3 W# w" z; \% p+ W, Y6 p' R2 l/ ~  Pinging 202.103.96.68 with 32 bytes of data: " y4 g- C+ {  \5 M8 b) `  G
   5 G! e6 L  I$ N- P
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) i, |8 q: z( ^* D. y+ q6 I   3 \- t+ t. m4 s- Z4 `
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & O; N7 f- ]% n1 D& g
  
+ c# @: y- L+ d8 M. y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ R; y; s3 h) X0 o3 X/ f! q. n
   9 O" \7 y2 O" h' {$ f6 F
  Request timed out.
- H# e5 z/ z1 g% |* e9 C3 B# N   + V/ s* G, d( U1 N
  ………………
6 ?4 t& o& i) R! y3 v! z   # G/ o& o+ P7 K4 r/ K
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: _+ B5 ~0 F: c; V& L* ^# f; c  
: Z3 v1 T6 G8 ?& z. K" o  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 ]3 l/ Y) v: g! R# q
  
1 ?8 M. J' _7 W$ w7 {  Ping statistics for 202.103.96.68:
8 X+ i8 y! _; N% l# ^" @   2 k% H3 s2 y* ]  ^7 E' J1 Z# r
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 8 C( _$ |5 g! D7 p5 S1 l
   5 A8 s; n' a5 _4 w5 e: L6 b
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 7 T3 h  |4 c; N- g( s
   . V/ {  u, T6 Z. P7 s+ ~0 x4 S8 l
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
. j; H( Q, D$ K  ^+ l  
2 P' J0 [' z/ }* k/ s- |  -l size Send buffer size. " W; a2 z. i7 `; p
   $ D& m3 C# d; y+ k
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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