返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
' b7 a8 {( B2 `: k) k0 s# v! C  
' w1 c6 M2 z0 v1 O& `, J+ `/ P. V  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 5 B# ]$ P' `$ ~- n( H
   4 c( u4 f! N4 ?& G8 }
  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 ; A; {. t5 n  N: o5 m$ y- N
   " x, j0 A  Q: T$ d. u) U$ n
  Options: 6 v6 c1 N' c, Y' Q
  
7 r# ]: ^9 u; v2 d5 d  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. * j) y. W# q; x- G' `5 ^
   ( @! A& P( k: A
  不停的ping地方主机,直到你按下Control-C。
9 |  F% U! d: C! a! o   : c: J% ^6 t( Q' W4 Z
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
9 @& R6 y5 X$ z1 S4 p! C; J   & `! r0 K! O! P$ y0 J
  -a Resolve addresses to hostnames. 2 t$ `, U: ]. b0 D2 g9 t3 R* o' N
  
( W, \  \) W9 }/ p! T' Z2 Z  解析计算机NetBios名。 ) ?: q# m! @" b5 C
   - W+ I# @+ U: h: Q
  示例:C:\>ping -a 192.168.1.21 : W' X$ g) S; m- `# T  H7 U
  
$ r: t" O1 S" ~- @2 _' K  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 S8 }9 G% E; X. G( P  
% w2 m) E9 J$ ^. {5 Y/ y0 X) P  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ }, ^8 ^( ], ^5 Q7 n* g
   % y, R0 m8 P; n4 v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. k  v9 l* ~: ~+ B; p4 J  
% w6 m- |1 Y; d5 A  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 a' W9 T7 C+ F& ]( Q% }0 p2 v# S, f+ j: V6 r4 T& a
  
* n- w! c5 _3 G) @. B  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! a( l+ E3 M! B! W+ r+ m, A  
3 j6 a8 A" ~6 |  Ping statistics for 192.168.1.21: ' e6 o9 F5 U- ~2 l( W' a' @
  
7 h; a, z' E/ N1 k  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
, }4 e) z9 f4 \   8 c9 Q) m1 D7 ]! g2 |8 `- f1 s2 o* L! ?: c
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
# _+ U  @- f. j- f/ X   3 T6 \* \! \; B4 E: Y
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
5 _2 ^+ t. \  S   8 T7 x% D" Q9 e7 L; r% S
  -n count Number of echo requests to send.
' U# Y- Z- U0 k8 M$ ~0 H: w- t   2 d6 Y  U. [" K1 X0 ]
  发送count指定的Echo数据包数。 ; G$ g" u% ?: U8 s6 R6 w' ]
  
; j' A7 ]! C4 e1 y  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; s" }) K: P! R* e4 W
   " Y- s( O, V6 h
  C:\>ping -n 50 202.103.96.68
9 D* u6 `+ w& O( l1 g# J" B: U   0 s+ R* A1 b0 v
  Pinging 202.103.96.68 with 32 bytes of data:
/ e; b& C6 C" L! Z1 h7 H  r   - N# E& Y' _8 c  {  E8 G' h. c% c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   h, F# I  q- G$ j4 `+ W1 C
   ; I* ?# O3 D6 a) I( S9 v8 N
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- g: j7 A1 p0 g& K; `8 H  
6 `# T) _' M" G& U9 t% c5 k+ B* i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . _0 W% t# x% A/ ^: n0 g3 V4 Z+ c0 l
   ( ^( i5 h1 ]1 W1 N9 q8 o' z
  Request timed out.
5 L+ W- |% P2 J- B   2 U! A0 G/ T4 C0 ]# O
  ………………
+ w1 p8 Y, d! P3 E6 |; D   , J/ C) m9 |5 ?% N; K) b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; T3 v2 g* s: `5 G+ H) Y; x/ e4 L
   . n# F5 p" I# G. b% L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 D& S, S' i8 s( l: D   2 W7 O, r/ P9 Q" ^
  Ping statistics for 202.103.96.68:
) q) l; z# O9 n+ U  
9 c& q8 E! `% P  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ' n# x# h; F) y1 Y6 X
  
' w1 D: O% y3 X) t% y3 D  Minimum = 40ms, Maximum = 51ms, Average = 46ms
6 c& X' i% }$ K# i1 O) S" f) P   9 {) V$ N( D% _0 _/ {4 X
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 1 q' I1 N, T& D, R
  
% X% R- k# q# Q  -l size Send buffer size.
) ^, ]/ d6 a6 \2 v1 g  
4 i  t% x, V  I8 T  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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