返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
  l1 o+ V& `: L1 ~, I   3 o  z% l: U  T+ q3 e1 h3 Z
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: & I* C7 _& x0 X. W- }( ]8 V" g
  
6 y; a3 a/ g/ ?# D  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 |3 u/ ^4 U0 ~' H! }
  
, u: A7 d8 P- d+ U; W. A: h6 Z& e1 e& S  Options:
& s# x3 E8 Y$ J( N8 J  
$ _0 S5 ?3 A6 ]! N, z/ j3 l2 O  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. & t) g$ ~9 l2 B& M# y/ o' H
   1 E- B0 a' R/ j# Y" |2 G; u
  不停的ping地方主机,直到你按下Control-C。 # W$ r% M0 s9 N. O
   " b/ @, }$ ]: s& J0 ~$ T% Q( S
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
& w5 e7 p3 C0 i$ z/ v7 \3 C   ; R' b: R. q7 b3 f6 B3 K
  -a Resolve addresses to hostnames. 9 b( ~; U7 ]" q6 u. w5 V0 a% g2 |6 W
  
7 w  s' _& _6 L- e: S/ w2 ~6 {8 Q  解析计算机NetBios名。
# T  r8 @( ~1 \2 ^, U  
" [1 N8 J- x0 l5 c  p2 V  示例:C:\>ping -a 192.168.1.21 ! f" r. H. @  S4 D% ^' y. F
   2 }1 Z# i6 ^7 k! i% f
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , \  G& q% |  g& c7 Q# F
   # A) _4 D7 @. r) ?
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! P, n) ~0 Z$ t: |0 J: @3 c# V   0 h! f: X2 ~- ~  D" W; T( r
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& f: L3 s  l+ F& k& T   1 b9 M& V9 I/ n0 O5 y: P6 h' O
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. c* C6 d, ?4 p
5 ~* G7 `+ x$ @; U1 h  Q4 T   2 V- S, F# ?- ?, \0 Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ c4 y& s. {. C  
0 e* V9 ?' j) \7 e' ]' [  Ping statistics for 192.168.1.21: , L; Y7 H3 B/ T/ P5 `
  
8 W3 j6 d& N- ?3 ~. e  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: , j1 {! P- }' ^1 i* b0 m
   / M( a8 Z' P0 ~. x8 K
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
/ L7 k! D7 \* x* e) o. r0 f   . @! ?5 ?3 `$ G. h: \
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。   m2 w7 O+ A0 D9 v
  
- h! t  _7 f& [1 Z# D' ?  -n count Number of echo requests to send.
* i& ?! n- z- _- |' o   3 L" n( ?1 n/ p) s* ~
  发送count指定的Echo数据包数。
( O! l9 _! O: z6 S  
% f. J+ v' p% a# M$ u1 R  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
  [6 X- J4 D) |7 Y$ y     v3 K# o) L0 ^
  C:\>ping -n 50 202.103.96.68
, n2 E- c% N; K- Y* g  
4 M' P  i, [7 D! G* A  Pinging 202.103.96.68 with 32 bytes of data:
  d1 i; |, Z- j  
  T+ r! L9 L0 [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 c9 V9 L% `$ _* `   3 n/ w9 }0 }2 Q( C7 u% S% {3 v
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 ]9 `) R( n5 C5 S  
1 R0 [) O1 q5 W  }- I  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* m' X- U; Z3 o   7 E5 Y$ [$ O) j. V4 g3 [6 B
  Request timed out. : J* p" A* v( N5 s9 [
   9 l! o: r8 m4 {8 S/ k
  ……………… " A/ t0 x4 @! C# i8 N. J1 M
  
* k  L' w) L" p( X* M! s# I  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 M% Y" M" k2 {: l2 a" X, E   - q" U4 A5 R7 ^, z/ M3 Q& r1 W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' Z8 {. j) d: z! H: x2 Q" W7 `( l  
  c  B/ y3 M$ g3 U: I  Ping statistics for 202.103.96.68:
4 E/ ?. M* y& t: a. y! Y# u  K  
. _$ r7 Q% G  @$ B! t  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
% N$ @0 d) u- W1 h   ) K0 n& ^4 G( B) }; h+ k
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 8 a1 x. X/ G- I" V
   0 K5 t) M& G0 _% F- b$ `6 s8 \+ [
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
0 C" z5 [; P& v( X8 W7 S- }- g/ a   ! v  L2 G& q7 j
  -l size Send buffer size.
+ I  c& t5 g+ j* s  
# y( M+ n9 G: J3 b- [4 n* C  v  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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