返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 & e1 E! O7 k  y, {- y7 {) j; O
  
6 j2 P( S5 j7 l2 _# v) E, b* a8 w  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: $ c  U, O) h) r$ P4 v! b
   ) B2 K. _: S8 \+ o3 o- y
  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
5 u! ^- m" W+ }; O$ W7 V0 _  
* I+ p5 R" _- @' \  s5 i  Options: / K" o8 J6 F6 }& K/ ?; f4 F
   9 q7 l: a) g+ Y6 O: k- i. }8 C3 z' V
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
) ]' \& j- ?: T& \   9 d2 |0 e. O3 u. {& p
  不停的ping地方主机,直到你按下Control-C。
- k& T9 W0 n0 u( Z: V   1 F/ E2 A  |/ _
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ! e9 j! K) U! ^  X( c
  
. x5 h" V/ y- Y. h9 Z4 }* j7 ~- W  -a Resolve addresses to hostnames. ; S/ X& F6 m+ L! ]
   : c; u. [9 h9 N  i0 s2 ?
  解析计算机NetBios名。 : h: b' ?  h- F( Y
   7 \; {' j6 D& w& a/ E$ w
  示例:C:\>ping -a 192.168.1.21 1 f- A9 _8 i$ B9 [9 z) h
  
9 H/ D8 m8 }! w$ W' m% q) k7 Q  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
9 S$ w5 m% f4 j: A8 {5 G  
/ C" Z8 W$ A: \2 j. R: J4 w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 g9 y7 ^3 W/ q' q  
8 P& h  G/ m  Z2 ?3 C% O$ o; \  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 F3 l( x7 o8 r9 X/ R) Z
  
$ [% @8 _2 C3 b( f# `5 ?( y! N3 [  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( s4 F3 b) w/ c& S$ h. l+ J2 D
& k% o. z5 ^% m* \0 ~. _
   / }) s8 m: A" G4 g: j' g
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * A5 |0 {& c6 H) x6 Z$ M
  
1 I; a1 c5 [; m  Ping statistics for 192.168.1.21:
, ?" a6 b8 J" ?. U, {   ' f6 A! F. G! x
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 F  ?# i# b; O   : \2 k( E( ]* d* T8 t8 W
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
0 \5 R; E; C4 O  B2 U9 ?$ \   - S8 f' \; G6 z' M( u) Z/ s
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 * y, @: Y) |% Z: t) Z/ Y- J* ]1 [
   5 n6 }0 f% ]) C
  -n count Number of echo requests to send.
1 P# X2 c# i6 `; a4 @+ v  w     H6 B  A+ O& V9 \! r2 B1 r8 L/ t
  发送count指定的Echo数据包数。
: S2 ^& W0 o* H. ]  
# @' g4 \+ R5 u9 @! W2 v. f  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 1 Z! s, O5 F: C- C
   2 G8 O$ T; [) v2 k
  C:\>ping -n 50 202.103.96.68 1 X( \- ?6 x2 X9 G+ U( ^! ^
   + E- X/ ~: u9 [2 S
  Pinging 202.103.96.68 with 32 bytes of data: & P1 V  {! W% [+ a+ C+ s- |
  
0 `! y8 L; [  _- ^  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: h' I! p- W4 G' j$ k: b   ) r4 q7 S0 M( d- A! [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % z! r9 \# l- Z( u) x
   - e! {2 l0 o+ w* ]* Z1 @
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* G; Y# K! M: b1 P/ w+ ?# P   / c0 T5 G9 o5 i- |
  Request timed out. 1 X1 D9 `9 V3 K/ L( H+ P  d
  
8 o4 u# w: q+ o( V) D  ……………… & [/ N( {4 H* _' @
   0 F5 c3 f) l! q$ ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% r* @2 p  ~( @1 P7 e. m2 \) t# f   2 b+ [. y. ], I% r. H* I" N4 _  x
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + i$ m- P5 N. z+ s8 X9 V
  
. q* S6 [7 }+ U4 R6 p  Ping statistics for 202.103.96.68: ! m! S% p! F0 h/ v/ {
  
3 z# ~' W4 i' S  U" i( ]5 q, S, t  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ) L" F4 ?, q8 a# O
   + y5 C" @5 S; p+ X0 U+ b
  Minimum = 40ms, Maximum = 51ms, Average = 46ms " Q! d, N3 w6 j/ a# B. x7 ^- V: h
   ( U9 \; Z% z1 H9 ?& s
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % ~; t8 i! I( I; x8 h7 d' K
   / t9 T' A; V1 k: |2 x9 ]
  -l size Send buffer size. 7 |% j) I) b2 \$ S/ q5 F
   1 l6 l/ z3 j3 ?+ T0 U
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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