返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
. E! P5 I6 w2 j# K& c  
% I8 t3 R: I% q8 v& ]+ r. P  ]  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ( y$ y1 Z7 U8 k* l2 b$ i. F
   + @4 W* Z1 a6 \- W& m; X' e. v
  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
* d% ?, x: W) u- l   ; p3 I# p9 k- j7 Z
  Options: , _8 m0 C# Y6 k4 ^0 {: u8 f
  
; O& f* m  _8 z9 g8 R' z$ n0 H  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
1 j/ B6 M+ `* }7 ]) {3 }  l   7 g" u9 {  s0 T/ t" Z3 X. c
  不停的ping地方主机,直到你按下Control-C。 1 V, Y- ]) S" k1 d. ~
   * {, [# [4 e5 |4 y& s) u
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 I. b$ ~% {* m4 h: g4 s$ M% s' r
  
, a  T4 u4 ^2 x6 H) H- f! c5 j  -a Resolve addresses to hostnames.
# W5 v" d5 f5 j& f4 d3 t1 L1 p" w  
! z+ z/ f, S5 W  K, x/ ^7 ^$ W  _6 U  解析计算机NetBios名。
5 @0 Z; s, h) N5 J) H# ^  
/ A# d8 c1 j5 x, C9 q  示例:C:\>ping -a 192.168.1.21 / q1 c6 X* _! d* P! C  \" R
   6 o0 o: a& [. t, a
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 4 A. ?2 m. Q, C+ X  ]- A9 r
   - i+ E. x* G1 C% {9 {9 v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: v. o5 A$ P" ^( k  ]# K, c  
5 s/ ]* G0 y0 a& b& Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & h2 }. h4 h# _" p, v( @) J
   7 v% A. L4 A* r) ~: k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. f+ ^  L) a  u7 c; C: ?# a- A/ H6 B- l+ [! |
   0 W. E, p2 f6 S; s3 w3 x5 M
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 u; M5 I, t4 E% ~5 R   2 M9 |! y3 j7 w$ K7 }
  Ping statistics for 192.168.1.21:
, i0 f' c! J+ q) S5 {  
8 N9 a- j; L2 S2 K. V/ R3 B3 q  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
, w7 D/ L2 X$ s- e' d  t  
0 u% O7 Z( R+ o) ^! `  Minimum = 0ms, Maximum = 0ms, Average = 0ms
  D' b' a. c# Q   - ?  t" c/ O& T7 p9 a
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
4 p0 f/ \, S: e5 n. y" ?  
0 a" b/ d  X& D  [& E0 i! r  -n count Number of echo requests to send. 4 m* I* _, F; V
  
+ n, n: u; K  n  发送count指定的Echo数据包数。
4 }. B0 \, l* Y2 e8 `: q- k  
% z8 ]- t6 H  ?/ a  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: % t$ O& C5 Y# M7 X/ E
  
; t- j1 r( m- b- s) |' z8 m  C:\>ping -n 50 202.103.96.68 0 c0 M" U+ q7 D' D8 }! I  B
  
7 W/ n! U) V; n9 f4 |7 K/ z  Pinging 202.103.96.68 with 32 bytes of data:
3 ~1 l( f- u- b0 I. p+ l   3 Z9 M6 ?+ ~7 d* W( f) L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% w, E2 x- P& z7 q% \   : Q& ~/ u5 b1 Y* D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 W# u) d8 N8 W6 p" V$ H
   6 R. ^- r+ V. |! I  d
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - v; G0 r9 F- w  v( H/ d% s2 p) C2 h# u
  
: [. ], S$ g2 e7 b4 e( u  Request timed out. 3 [2 C! ]. @+ V! q2 W9 ]- n. {- Y
   0 |% Y1 M  y' g& A
  ………………
2 D6 d* V) C- N# }# j3 F  
9 I/ M7 v- L) z6 l. t. X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) I( e% w( D6 _0 N7 ]6 b
   : v, ?7 P9 H, z2 Y: l
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 M; Y4 |' [1 C" c" M& _& R   : s3 V4 w2 g. ~$ M8 t; g/ i" I  h
  Ping statistics for 202.103.96.68:
2 q2 ^# E- T/ {% u. u% V   ' F- r9 T- w; U* [: ]. L; K
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
: z$ N$ g# p; _, ~9 I4 t7 ~/ X   1 f# a3 I: G4 }" w
  Minimum = 40ms, Maximum = 51ms, Average = 46ms   i" J3 s& a( B7 ~" N9 L
   / q% K: p' E0 D5 C9 a  S
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 - N' N' X- Y+ p- y0 A4 C& T' o
  
' s9 |" M6 ^& H% L  -l size Send buffer size. 8 i  H9 J/ t/ x, f' L' U' S4 X
  
: p+ I) J: P. j  定义echo数据包大小。
89w.org捌玖网络

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