返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 , r# _' {2 |7 t+ n' I$ g
  
- m1 t( f$ M9 ^2 f! z% D  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 0 G# e- d0 R/ N& R
  
& ^( N4 V- x9 r9 \  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
. _2 Y9 C: S2 t! n# d. s   : p6 ?) h+ U8 Z" w" ~/ f; t; c
  Options:
; d. `+ |% s" s7 k% X  
+ A+ e2 y$ C1 C9 N  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. " e9 h- b% P3 b$ e1 S
   - K& q( o3 x& b& o- w
  不停的ping地方主机,直到你按下Control-C。 0 w* y0 Q, D& R5 F
   $ v2 V- ^) y; u( N4 D$ i4 O
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 6 H2 ^; m" s* n2 u7 b
  
9 c7 `" p' _; i  -a Resolve addresses to hostnames.
4 F5 {6 |; q" d   ! M7 h) _* {! k& g4 B, G8 v
  解析计算机NetBios名。
% M/ Z4 \9 }: n  
5 T- E4 b3 m6 n6 o* a6 e  H" w  示例:C:\>ping -a 192.168.1.21
3 P& e" y& T( C4 p  p     e$ n4 V  B; ?: V& i' g
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: : l* `- k$ k* f0 s5 |
   ; ~+ y  l% |6 L: s" P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 k. S7 a, h0 N/ ]  
  f2 M+ Q2 D  e3 y$ p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " i; o' C& I! g
  
9 W: _. Q; Q  p% d5 C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* `5 M) T7 f1 C2 S1 I! z7 e
" @8 o7 R% }7 k1 y1 Z   5 P8 ]" O# U8 D
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . |% t+ `* y( l  W8 o  G' y% }1 e
   : n' V6 a, e0 r$ y. I/ b  o  U
  Ping statistics for 192.168.1.21: * |3 P$ o  W3 \2 S6 g  A# {
  
+ P0 p! ~! T$ a  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
! _4 v  |5 h( w8 t, U  
9 e0 [# S; Z4 P) Y: N0 `* s  Minimum = 0ms, Maximum = 0ms, Average = 0ms ! i: }" X  P* t
   ! S  c8 c. r- Y- H
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
/ a" w1 E" D6 c" A0 t   # B& x% d# e( \; r7 X7 a& |+ a# v
  -n count Number of echo requests to send. 0 m+ Q5 i. Y' U# V; ^& D" R
  
) Q1 v  ]! e/ {. x! ^; L: n% m  发送count指定的Echo数据包数。
- c8 n; J3 g0 E/ x   7 Y1 [7 S- Y% w7 W0 ~  c
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
9 ?9 ?0 ]! r1 B) |  
9 ]. g7 S& B' W, p# W6 L  C:\>ping -n 50 202.103.96.68 - y! L0 `; e4 [) L  @# W, j/ j' G
   - ?; k$ x( g! y
  Pinging 202.103.96.68 with 32 bytes of data: ! S% c4 E# K! l8 a. D
   + z$ @, p0 ]. v) B) a& U* ]+ ~
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& u1 G& r+ n+ A9 s0 n  r   ' x. ~0 S+ g2 v. ^  T* D+ {
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# q5 w, X' _  }) I   2 B" L7 p$ g( Z' {$ T
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 T2 I- a% |+ j$ A+ a/ H  
# o. S! \% b! u; o  Request timed out.
* }% _: R. \" @! w' U+ i! j, O) w   6 Q8 X( q# j" ]3 x$ z
  ………………
: V9 i9 A6 p1 O/ E( t" M   ( U/ j& g3 b0 j- P$ b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 ^* L! k7 `1 e9 u$ ]$ c) m  
: O/ j: b3 S9 D2 \( ~  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & F4 N1 M  _. S; E- S
   + z/ b. A/ J0 o/ Z) f: M* f0 M! R
  Ping statistics for 202.103.96.68:
9 @# e- _/ h/ a( Z! a   / L! x9 A; J/ q9 ?; ~% x
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 9 J: ^( F! P( {0 L  U( z
  
8 O3 A- h$ y$ ~+ e  Minimum = 40ms, Maximum = 51ms, Average = 46ms
  a2 f/ I# H2 s; _9 l( F% A  I7 l     C+ V' C* y5 J
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 : j, z  D4 v* n: i
  
5 z" e! r! _$ s6 F& ]# h2 d1 r  -l size Send buffer size.
$ D8 m' g! g' c9 c& ]+ [9 U5 N   9 M- c7 s; f' g7 \$ P& y4 l
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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