返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 2 d9 L! f) X" J  f4 p+ ?
   ; [  H+ c! S  f6 G
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
) i: ]7 z0 G7 c7 o- o  
/ i+ Y$ X1 b( B/ L* r) J- {  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 . |- `- ^& v* n" {/ p
   ; s- L. }1 _, A, v# t; W
  Options:
0 ?- _' D, L8 U6 l   1 ^* h3 h; t' G: E9 D4 Y4 R- n  d
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
& @( }7 g; D* Q5 p- e0 y* K3 b7 S  
5 Q: ]6 A% c- i/ X  o( M  不停的ping地方主机,直到你按下Control-C。 ; Y$ n3 q/ A8 ^# S: K0 T4 M
   . p: {$ K6 T: {, I1 A7 V! i& q
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
+ z+ v! g+ i9 A3 H; C+ c   : a, ?% ~9 J8 C7 Z1 Q2 q5 m$ x
  -a Resolve addresses to hostnames.
' V- i; e) z1 ]6 U   : D0 H  K% D5 x1 c1 b
  解析计算机NetBios名。
2 p0 v% b! u; ]1 s2 f' x8 d2 l# _   ' W9 H0 M5 f6 n; x2 Y" O9 X
  示例:C:\>ping -a 192.168.1.21 / z; t  J$ o; D" B2 _
   ' V6 |  o, I$ D; z- M  ]& j% K
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , l6 b; u/ p1 C8 \; q( e
   2 I8 F' b6 c/ [' B6 C* R
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, b( Z/ K+ S3 ?  h  
! E! E( h9 o0 R6 i# O+ [  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 W1 R* R- A7 m( X
   + R2 K$ c" l( I9 N7 W  A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' v4 D% q2 H0 u
! F2 v  q/ H+ H8 L  
, g/ m  Q" ?3 {  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , r0 K. D# w2 Z
   # b/ h3 v  |- K
  Ping statistics for 192.168.1.21:
6 ]. `9 r8 W( h; g, Y1 [   ; W/ P5 W1 x# P" {$ t& |
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 u- P- s1 i1 m+ u  
7 {3 b: Z$ x6 ^/ S  Minimum = 0ms, Maximum = 0ms, Average = 0ms
6 D+ `2 C& M6 r/ Y" r  \8 z, X, Z   / e* H8 D: }) K8 \& l5 K' d6 V
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 & k  X' `% e, L$ c$ C- r% a5 ^- P, I
   % n* E0 L5 p- M. z& j
  -n count Number of echo requests to send.
& ~8 ]3 q: O! P7 }  u! @. J- C( }9 B   ) l" ]0 U* M1 Z; l! a' b
  发送count指定的Echo数据包数。
6 e# w9 r6 F# d: w# }  
2 m4 k0 D3 N* a) D  g/ C  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
5 H$ e- F7 ]5 D6 D% s; @! Y  
3 [2 a% R$ ]# J) ?  C:\>ping -n 50 202.103.96.68
/ K4 i  a  a' t9 [% z  
0 b' a, K; A5 @6 Y  o! B1 _! C  Pinging 202.103.96.68 with 32 bytes of data: % o2 J9 ^0 k! `: s8 ?+ U+ d8 k4 X
  
4 j4 v) {) Y5 p- s' Z& s! G! t  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 ~* Z- s, u; |. o  f( t, k   ) k" z7 D& S  n0 {, @) ~: `9 i5 C
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 D; I: `: [% c& U. Z6 g+ C
  
8 A, _1 ]$ w3 F# e  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 H  U" B! l* n: j& Z  
7 Y6 ?* u2 f% f* [2 O( {  Request timed out. 4 y# u4 f  Z% ?4 J$ I
   + j* d3 X$ P' z0 T9 M. j9 q% i
  ……………… 7 O* a0 `: k  j. r
   9 f; f. S1 `* R" p; [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # m  @  o& B& O1 E
   : U: n6 u. a% V. a. Q+ Q( O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ d1 j  o- g' i( r9 a+ d1 K9 v' h   + B9 a  Z+ z) V( s4 f, k0 T
  Ping statistics for 202.103.96.68: ( i8 `! k4 g6 v9 C  l
   6 a1 C$ v3 R) V  n, @+ n9 H
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
9 P6 ?! R% j& a8 t# ^  R5 Z9 P   ( j8 l- x8 E$ D5 t  ~+ _) o- W# c
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 0 h, B" H6 ]- C
  
2 E5 R- g6 T0 R: e  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
2 g. K& M7 g. q   & C6 {! S+ [& k: S: w
  -l size Send buffer size. " z$ q& i9 O# h; ^" y% u" ]4 @
  
, ?5 U' R; Z$ A3 @( [7 ?  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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