返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ' @! N- q2 P% I) _" _4 S6 b
  
& P; P) D9 g$ T3 t4 a  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
/ g5 ]7 k( s" n   # e- Z  O5 I$ `2 P* o
  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 p( |3 d/ h) V* `7 Q2 k! u/ K0 M2 a  
4 a5 f. E4 ^# ?3 Y1 T  Options: ) y. D4 u2 ~2 _3 p+ @5 f1 ]7 Q
  
/ t, ~8 g5 Q; d/ d0 n  `1 U  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. " }7 G$ Q0 H6 |; A) ~, m, m
  
$ U2 u( {2 }* V' ^2 S2 X  不停的ping地方主机,直到你按下Control-C。
0 K0 O) n+ g# a, h# a   , D, p' b% o, [6 D; i
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * |: i* H2 l, E: M. Y5 ~* ?
   5 O0 {: G' O6 o9 Z& z
  -a Resolve addresses to hostnames. ; y, D& ^+ O% h+ D% [) L* d( A
  
, m* ~3 h: [' P5 S1 Q  F# y  解析计算机NetBios名。
2 {  V( L: |! I4 ~) o/ x' e9 V' q  
% m9 Q( _5 l/ G# t2 k1 c: F. P2 Y  示例:C:\>ping -a 192.168.1.21
& ?& |6 P* O* Z% r: j) {' P   ' `5 a. p. F8 V) N. f
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
; K. E# o: t1 R) ^' E- J  
/ A) Z/ l) L5 w) ^) K  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + A3 T: v+ j1 i. x/ g3 f
   1 h7 L7 w. A0 q; G
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . d  ]) g5 R9 s( G. f# r' B; K
   9 o  ^# u/ k( Q" m9 x+ ^% F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , y0 F) K3 Y) H5 x$ T; z
3 `  o3 h! c+ q% P( \6 a, C
   # O4 A( d6 [% V$ d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& _& @% S! r: @: q& H   $ Z# L5 h. ^2 f3 u" X1 G
  Ping statistics for 192.168.1.21: - `: E; {0 y' b2 c7 D
   , c' F4 h' b3 M+ O" b
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
) \; o+ k) j( }0 g- m8 V( s* ^  
: q( |" u- u4 I/ c  Minimum = 0ms, Maximum = 0ms, Average = 0ms
. S6 I6 {2 ]7 X( e: G4 R" Q; v( B- n. p/ J  
; I2 W( g  T) |: \& P' r0 K  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 # e0 @2 `( v3 g9 m+ U  S
   + D$ l6 i/ y  i; }$ w! |
  -n count Number of echo requests to send. $ G, K/ s% g- ?0 Y& {% J; d
   & t  V5 Z& A( _" j3 }0 Z
  发送count指定的Echo数据包数。
% a+ k1 B! D4 e/ i   + l! ^/ \+ q) P5 G* L8 V
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; V' a! i! o$ Y- X/ N
  
0 p; b3 U: g& J# F: H% B  C:\>ping -n 50 202.103.96.68
6 [+ g0 I2 A  R. d. N6 d5 X   - `) u4 z9 d' q, B: Z
  Pinging 202.103.96.68 with 32 bytes of data:
! ?+ L' ~' |/ F   " ^1 l* z" ?: `
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# F( A# Z7 H5 a9 W  
5 v+ [$ e3 L) o4 e# |, j2 s  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" d8 M6 |' V5 o6 g6 J' c- k  R- b  
& G, E6 H# G7 Z0 {/ V/ \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' h# V( |) L  U" v! q
   % S+ ^% _. \* |
  Request timed out. " p. C9 e  v0 \: V! r
  
5 B. m6 H, n( J+ s: E/ F  g  ………………
- J8 u$ Y5 z3 }( L' d0 A  
! n+ N4 O. L4 m  @# E  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / L- p: u) V& Y( M
   0 s) z" J1 M) L4 I  o
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / ]2 U. `0 a0 x& n7 T6 w
   , K; R) R, c; X# p8 W8 B& }
  Ping statistics for 202.103.96.68:
" Q% X# j0 q# C- X( |8 f   ! m% @. u9 r5 s! C3 N! y5 ?
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ! l9 t0 B1 q# b. |& c
   ! Q+ J$ S, h: Q* U+ e, a- x
  Minimum = 40ms, Maximum = 51ms, Average = 46ms " J5 e1 G& C4 k( u8 z
   8 W: G! m$ g: |( y0 I8 ^% y
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 & X2 f: f  O8 y" H: r# U
   & V, B9 ^: Y# W7 ]
  -l size Send buffer size. 8 X2 _8 E" @2 K! N8 h, u/ Z5 i
  
0 a$ \- s* ^0 z5 }  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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