返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
/ j) @5 ?' m1 i! L  E' @   . O& J* H" J+ T- n% F
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
+ V3 [2 A6 u, Y9 x. \; e  c   2 u' A& Z) g7 b% s. b9 K
  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 - J. s* _4 w+ z: e$ ?
   $ y" L6 k! ^3 A/ P
  Options: $ \" [5 Z/ N  |5 |9 ~! U1 V3 c
  
+ z( }* E/ o: Q. s  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 0 ~) D  z2 c0 y1 V! e
   & e7 X$ Z1 w7 O1 `" V+ I7 M6 i
  不停的ping地方主机,直到你按下Control-C。
3 q8 S* {! u+ O& y# V8 R' B7 e  
* K6 }  w2 B" b  c  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ! M+ Z9 m+ W$ |4 s4 h7 E" j
  
, W3 e& l0 ^7 J; J( ~6 A9 N  -a Resolve addresses to hostnames.
# p% R7 L0 a3 E& z  m# m% K% p  
/ x; Y9 m" Y3 Q1 G1 V  R  解析计算机NetBios名。 7 O  j9 m4 f( _
  
: c% A- {. n, _1 i  示例:C:\>ping -a 192.168.1.21
- Y! ]1 b3 k2 h8 F3 L  
) r. l  m3 ^) e8 v$ B: ?  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 ~$ D1 `3 ^9 ^% h4 _  
. n/ Z" t) N5 c& R  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 h: I7 B* B$ Z; z# H  S+ v  
+ M* k5 A0 W0 E: x( c- N: n  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# ?* }0 q! F; ]5 c, |  
; d1 d  ?$ x' }' S( q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 _% ^! y! Y" B; W
* d* k% Z& K9 P  
' @+ g+ p" m" _2 F1 i9 e  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! G& x) j: z  c5 p1 ?% W, D7 `  
$ k8 q- s$ q: n3 @9 t5 @* Y; z8 D, S  Ping statistics for 192.168.1.21:
3 O* G# t' i. ?" ]* e, E, z" K   - Q  `- N' f+ y" {0 G4 i
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ' P  p) O9 s6 d8 W" {
   9 w$ s7 S( l! _1 M6 o
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
+ A8 Z. u, `' w5 b! H8 |. X   * }7 J0 B# s5 Q1 m2 X' g2 y
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
- V* J0 C( T/ J- L- x" L' U   ' e$ G; Y4 V  v! D% I. D9 K  D
  -n count Number of echo requests to send.
0 }7 q( j' L+ p: j  
- l" M- z8 A  w, F7 U  发送count指定的Echo数据包数。
( d, T# A3 t; i  
# p0 m0 D- k- p/ }# L  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
2 w" Y3 C. U+ q% _3 y   . Y! d( F3 e! g# ^
  C:\>ping -n 50 202.103.96.68 * z: @! \8 e/ ]' D5 G, \) }
  
9 g6 ?6 z- [3 y" O3 j2 B7 H  Pinging 202.103.96.68 with 32 bytes of data:
# ?& v& s/ Q) ^$ n+ y  
; t7 r5 A6 S- ^) s7 j* l7 G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ z2 k2 n* `. o" G& `0 p& D  
, h3 W0 h7 X+ }- y( d  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% t& [% n/ M  Q! W' b  x  
1 c( Q, ^0 _1 p) |5 b7 m  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 j* n8 f- k2 ~, O) ?
   # R: H4 p2 S& h& O0 h2 p* p
  Request timed out. ( r! a2 o$ D6 T3 X. J
     R: @% x0 }/ l
  ………………
; i% G& f& X: s& j: _+ `3 D   3 J; j8 d! N& L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 w6 y. \+ v' y1 q   ( @5 ?/ \/ J6 X/ Q* T1 T. X
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 A8 f! n" t4 {6 H& _" k: ^
  
$ k0 p; R& m, `& ^$ G  Ping statistics for 202.103.96.68: - G1 `7 q  O" I. @
   * ]. f% n; m7 ?& G6 N  V7 \8 @
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
6 A5 q! W$ m% E9 K1 z; `3 [   ! m$ n+ u8 o, ^2 O2 O% l* z, |8 Z# J( C
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ) T; a( e# b5 m: v
  
( ?: @1 T! s+ p, a! W  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
* n0 [1 F2 x; ~( c  M$ q3 L   3 f6 l1 B) D' x+ }; w
  -l size Send buffer size.
4 a0 ^' a/ X. G   8 R" V" F- |7 }' R
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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