返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 % Z4 D  m5 w! B# w, |
   3 B, @* y% l1 [- L
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
6 x. [9 l$ l7 Q  
# S- `$ c  K1 x3 Q, n  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 + R' ^' [1 l2 b. z% Q4 i
  
2 L& L# j4 O" C4 l, s  Options:
. B  M7 x: r; t7 U" |# i1 v   4 L# H' H- k& @7 c% y# h
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
1 D2 x7 g! u3 e/ [. X9 y: T  
& X3 K% h, ]% w9 f& C; T  不停的ping地方主机,直到你按下Control-C。
7 g: Z* W! y2 X9 V* V  E1 k8 J" o   , `2 p7 V5 b5 r' |! }/ n
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
: K7 s% F$ ^1 D4 o$ k   $ c  r2 X$ @$ [2 f4 T! j
  -a Resolve addresses to hostnames. ; X5 n: p8 N& D$ j
   0 q) _) x4 Z* t/ W# D, V
  解析计算机NetBios名。
% k, Y* @. }5 i5 o/ f   # ]2 n9 v2 x3 e' Y' q! C% z
  示例:C:\>ping -a 192.168.1.21
8 f8 }' l/ q) S, G8 Q   ( g7 ]; S, a1 K0 ]
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
8 E9 s% g% H+ e( h3 w  
6 @4 [5 w) X1 |! ~) s5 l7 U- @  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 [9 M3 Y% g/ p8 N9 j
  
' [! b. J7 b; y3 G- p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  J2 O& a) p( a4 ]   5 L+ Z1 X* b% _, e. b* S
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % k  i# ^' V0 e0 {* `$ L
1 n  `, T* o% k* M
  
/ Y. c: J7 Y: {% s1 H( h) i  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # E0 _, T2 D* V& Q- Y" k
  
7 H5 J0 A( R* @$ {4 `& V' n* [  Ping statistics for 192.168.1.21: / v" n. t. [" [8 k) P2 X* x
  
- W, x+ `$ K- y3 w5 S1 I  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 7 I( K5 d7 a! c# U9 b2 q) @
   : G+ y3 ]+ t8 p: Y9 T; I- z% ?+ p
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 0 w3 e" N! L9 K9 s
   * N: E) s2 r, B
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
3 e( Z5 D: j& k   ' Z$ o1 }. P9 n1 C
  -n count Number of echo requests to send. ) V; R! w9 x2 E8 d  i) g- X
  
* O  k$ x/ {3 L  发送count指定的Echo数据包数。 4 \  [8 g1 K/ n' W* o
   2 @/ A' T% D2 ]) a
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 l7 ^* M! t: \
  
  K9 ?& }0 _9 K; J! Z$ ^  C:\>ping -n 50 202.103.96.68
8 k- l/ s- c! Y' b0 [( L  
, a% ~( }" K4 c2 h. G8 p" g; u  Pinging 202.103.96.68 with 32 bytes of data:
2 d$ U' n! x% o3 O( ]   1 \" E4 Y5 q- s% A
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; h9 X2 z4 \6 R$ L
   ) q) t9 K( ^  D+ W) W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & p# G; ^0 J4 T$ l* y! e
   9 `$ B; M1 N7 k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 ]% m: D& `. `4 y, g5 _4 A' n
   8 a$ g$ |! r, y5 D
  Request timed out.
$ i) `6 ]+ t+ n2 @9 y4 V) G. [, l) K  
0 N1 Z5 Z$ i" X) Y4 N; F  ……………… / D8 _# x2 r0 m4 K0 E. O
  
% X, M; _2 T' X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% {2 K* O1 T5 J  
# o( Z: }- S7 I3 J+ x  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ \# d' p) ?. D0 k   9 O4 W, I" d8 K% O4 I7 N
  Ping statistics for 202.103.96.68:
* F' ~, \% l+ u, q% m' \  V# t, k  
: O) h4 K, ?& T2 d5 j9 F0 E  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ! D* X5 v( L1 J" T4 Q
   9 }; R( o' I1 j# W
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
, J7 t0 Z8 S4 e+ J2 H6 h3 e  
- `. n7 B( O/ P  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
$ [- l( x7 I7 L! D   5 B1 j, v3 a8 F% L9 `" o0 x: p
  -l size Send buffer size. 2 T5 A$ k0 E' t: i
   0 z+ o6 j$ K: I3 k/ P" V9 y2 L+ _4 T
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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