返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
0 G+ @3 E* `4 I0 C* K  
6 c% @: @" _" n  l/ U& d' p) J$ |  C  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , t0 o( i/ P" M5 K4 o
   + y6 `, A& ]2 Q( f# |) H: R% a
  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
' ~& x" V0 V( K* P# W$ H   2 Z+ s" M, H& r. \- g; F: b
  Options: ' G+ y9 }  p6 n3 B
  
! x" G/ j* z9 q* M% d, _  ^  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 6 y2 J' K( a2 b& b. f6 B7 ]
   & h, m# o/ N9 |0 |& q; o
  不停的ping地方主机,直到你按下Control-C。
: d( C5 l8 d' L& a  
1 u  ~0 C3 D) n  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
  K) P% G! @, [   . ?$ `9 R5 ]5 E1 {1 L
  -a Resolve addresses to hostnames. 3 T/ Q% Q1 v, O7 r) x! X" G3 {0 V
   . P- i8 ]4 ?  a: u( {) V+ ?
  解析计算机NetBios名。
  R' W& o: _2 Z! d. O' q) ~8 u  
/ R9 b4 V- k3 b) x; {  示例:C:\>ping -a 192.168.1.21
# U: P/ t) T7 |, i( S, J* Z  
" ~+ |, L% R- [2 k  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( ]7 c/ P4 ^( h/ B
   3 N5 f. d! B  p' d3 x: j
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' t, n0 D4 i# X+ t2 C
   ! P% d' o: O1 L
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   W2 Q- R4 n+ |- q# F/ O, n( S( u! |
  
" K0 H" {5 `2 ?8 N) G  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # d3 }* k# K; p; v
1 B- C% @2 c, n- o! K' ]
  
" f; T, L$ p( x  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. _' [& q# T( R) ^8 J   ) \9 P; \# [$ F9 A* e) l; W' |/ E: f
  Ping statistics for 192.168.1.21:
/ j4 b# j8 j0 S- l   " X7 `/ q2 X# @  R3 A2 h( }
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 4 y6 i/ A6 F% }7 y2 j' R+ z, `  v: @
   - b* v$ {" K1 J4 K
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ( W- b  d+ [; T0 F/ W
  
8 c8 p* m3 L4 t. O  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
' @7 |  |: o; f; Z7 |$ |2 c- F( y  
1 B& f/ @/ M" W) Q2 N  -n count Number of echo requests to send.
+ U7 X! r# L! N5 F) L  
+ |% |$ \+ l9 t  发送count指定的Echo数据包数。 - O; H8 P" W( P# K% o
   0 [6 u! i8 _/ P
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
* v, K. O% r, h: _( N1 c) b8 U  
5 @" R' A1 q# [( V% i' G1 U  C:\>ping -n 50 202.103.96.68 ; T$ j  t5 W9 B2 Y5 [4 t
   . b9 e( s& \+ |; u
  Pinging 202.103.96.68 with 32 bytes of data:
" `6 s, f$ Y1 ~; R2 }, z' z0 a& m  
* y% _; G5 m; i: E! }' W$ B  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) h- e+ \( {4 t  l  p
  
! u/ K# i8 t% C$ X# [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 r: Z- x# b; V( x& X
  
/ x- s  y& M% X1 K8 O  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * f& O# ]/ s/ H6 V  F1 S. x
   " k: T  d9 i7 b1 m
  Request timed out.
- ^) |6 ?7 `( b  
. v7 {( g$ i3 {6 ?. a& S, q4 Z: {  \1 U  ………………
: h9 u+ y( Q( a" `3 ]) Q6 |6 V   0 {" r- \& _% a) l0 ?7 B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 D/ P4 R) k3 w
  
# d4 J2 r2 c( g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 T+ w5 A( O6 n0 p3 Y; L2 _  
  I+ U1 M% d* Y& A  Ping statistics for 202.103.96.68: - i9 s- b, h5 W4 ?5 _, m( p
  
2 e$ Q/ W6 [' i, E  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 7 p  o3 N! z! Q5 K3 x* Z
   . m5 n: n7 P* s2 W2 n
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
* W* c+ I  ?! i6 T- G" j  
; r9 o9 Z' G4 x" l0 `  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
+ R- D" R" t! @  
' {) j( t* m6 J: d4 X' o# m: M; F  -l size Send buffer size. # N9 A, y1 _4 T. O9 Z* s2 ^6 c
  
4 U. t0 @$ a! I+ g! E5 H  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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