返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
- P6 I$ i6 g- A5 q: a   1 l7 A- Q( T: `$ P5 d0 Z4 Q$ R# |, [
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ( b! q6 `0 }  T8 q: m0 l
  
7 C9 G: x8 d. L0 ^  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
: n' ]' O# k+ c. k1 a9 ~2 Q' D3 d" Q  
+ B& K0 w( }' F# Q8 G' y( i  Options:
# q# }% ~! R* c3 O  
$ E8 i( Z& J0 ~( G  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. $ ?7 x2 P" {% D# l/ r9 _( P; L
  
" n2 M* @. a" q4 O  不停的ping地方主机,直到你按下Control-C。
% F) x1 p/ i8 u% W0 n5 k+ G# U  
" D& s" \7 z1 W# k, j# B* }  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
. O% q( Y" p' q0 _  \$ S9 H   & `5 M; f; w6 k8 [- I7 x
  -a Resolve addresses to hostnames.   Z- \% Z( ?  h* @: g: f( V) i
   & G& c9 K% W0 I
  解析计算机NetBios名。
0 L0 y4 ^* Q5 i0 ~3 z$ z   " H, ?. h2 V  }4 J5 Y3 B
  示例:C:\>ping -a 192.168.1.21
4 F. g% ~' ]# K& f  b6 J  
$ A: P* D6 S7 {0 ~* h7 a  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
2 k& x0 o# s6 S/ t   7 {" S4 ^4 X6 D  i( h$ M
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 z6 r, P  v7 k
  
6 I7 d! x; I, A  ^5 Y2 X9 y6 ]( k  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 ]; C: g6 C" u2 C5 L9 g
  
0 [9 `' z1 g6 Y8 K% I. m  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 h( [! J# ]+ n/ V& r
0 J/ N3 k; T; |1 a2 n
   & s1 J: \/ v# h5 }7 d% i" ~
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 T1 Q6 Q2 V9 t$ V' T   . T5 T3 b. a  k: \
  Ping statistics for 192.168.1.21:
3 f7 R+ _3 V- u6 l   ) a, T3 k, U; n8 c, K" B
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 5 l/ ?. v* u* n' d; c' c% T+ v
  
' y' |/ c( q& W$ \  Minimum = 0ms, Maximum = 0ms, Average = 0ms
4 ?; t! g, A% P6 U8 e  
) I" t9 ?+ w- p" [- u* c* |  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
/ q) [; n! V# ~) X, @9 l! n- E  
6 P4 s; y( J" u- y3 t% m  -n count Number of echo requests to send. & D4 g0 {- R) q: F
   ) W) b% R$ J; r" z
  发送count指定的Echo数据包数。
& V* O' o3 ?$ u- Q, Y   ' y2 A& b& A% m; I& w
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 e3 w5 L7 w/ @4 q6 ~. |) \
   * k) m% Y# f) s- l; {$ z8 c
  C:\>ping -n 50 202.103.96.68
/ z, y3 }  ]4 z: |  
" N7 I: Z: Y5 Y' i; i8 A8 e  Pinging 202.103.96.68 with 32 bytes of data:
1 i. U- [$ X7 B2 u! X2 x- J  
& b, s1 N2 J9 |7 z$ K' k! r( F  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 J) l( W3 s6 C  
6 N$ o  w9 v  o+ [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ t. E5 J; Z+ A2 P   2 l- G, g1 ~& W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) a0 z9 ~3 |; e$ E2 e/ e, J  
* B' b* |. h/ ]* A0 F3 X  Request timed out. " c$ q, U* j2 z
   . n* _/ P7 @  `8 W4 d+ ?5 [; x
  ………………
. F: H! @3 y& _) G; Y- M  
/ t# E) B. O8 N# d2 D4 x  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( ?/ E- ^1 v1 t  M* ^6 U/ S  
$ j5 K" z( |3 y/ r6 W4 E: w2 ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 E1 C; @6 m( o8 w9 y4 `6 J   4 r' x9 K) T1 ^2 f* |
  Ping statistics for 202.103.96.68:
% Y+ M. g! @* K( Z- B   ! m. A9 y1 l' U' w& j
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
: i, J* P9 O. `; h9 p" Y# d. J   1 |/ s1 ?6 ^5 w  `( i9 U. r1 Y
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
& m# e% n, B6 k5 c+ m   * _. ^: _5 J* ^
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
. A3 s& [* q8 T% g   & O; F" ^$ j; D& \1 d; [9 c' b9 x
  -l size Send buffer size. & j( |# g8 ]8 {1 {: u6 ~
   % \8 {5 e2 q2 \7 {9 V  w7 `
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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