返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
" h. Z3 `1 v+ v6 o' C$ [, F  
9 `7 d* C& X; \' W  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: # l( ~5 Q$ v/ s; ^* D0 ^$ c
  
9 o0 T: v! ?7 Q9 n* r& S  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 & x( @# X* d! @- F
  
# Q# q& z7 m- }5 u( m0 ~8 T  Options:
4 y1 f: ]' ?0 _* Z4 Q" h  
8 |0 C6 d8 b( H; C5 o- y% J7 m" v  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. / U2 R3 `: V: w" K& a9 A$ R' c& K
  
' l0 k  ]3 a3 O* h) F  不停的ping地方主机,直到你按下Control-C。   h! h! x3 W0 C: i( H& @
  
! ^( B$ V2 n6 t6 h3 ~  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " d) h0 ^& p/ d7 t
   ( r, q5 s* q! u+ ?/ f
  -a Resolve addresses to hostnames.
- j  N, V4 V7 {9 r- z+ D; Y( M# ]2 w   $ X! N' B* [8 K/ J" g
  解析计算机NetBios名。
5 O) B- [4 B9 j: Z6 @   5 [$ i4 v8 F, g# o0 V( b6 `
  示例:C:\>ping -a 192.168.1.21
. J9 n6 q: Z7 w5 K6 Y* i! O   + J8 b# f7 z# F
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 3 ?9 K& U+ F4 p. W
  
% @5 \% f' ^( i* e$ e  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 B* m7 q. o- x) h: z1 i  
- a  ~/ g( c9 X, K9 U  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 P% L; E1 }, j" m( M0 o5 P' S
   # g! I$ c$ U7 B9 S
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 |; o$ A5 I7 A# ~: a/ n

7 ~# L. X  I7 Q4 u& f4 K  
. V2 q# n# g( V# n+ z* K& Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 C- l5 K7 M9 g9 g' `* u   , a  {. X2 e6 T$ [" m6 e- Z8 V
  Ping statistics for 192.168.1.21: 0 P9 t7 d. t5 c: e7 L! @
  
- x+ _( {* ]. E* V  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
; j* g1 H7 g! n+ h" K8 U6 ]  
; F( w% n7 I5 X  Minimum = 0ms, Maximum = 0ms, Average = 0ms 3 |. l* B# o& p, T3 e% J
   * s+ f! j7 s+ l# [& X" E" V
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
6 H* J; D# V4 m& O$ \   3 M% S& ]5 U- V3 G  B
  -n count Number of echo requests to send.
( f8 F; f6 l. V' X   6 e4 I6 h& e$ {
  发送count指定的Echo数据包数。
; m4 d+ U% c- P  
! a6 M! i9 I1 d4 w  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
/ F$ F* L& ]2 J0 R! ]   ; M% x6 E9 |9 ^' w# X% O( y% U
  C:\>ping -n 50 202.103.96.68
& y( i: s' `  j5 ~* L& q  
6 @) {* Q: g) t  Pinging 202.103.96.68 with 32 bytes of data: ( u7 F" n. }4 F$ m$ s
   + o# F( w  F5 T- v: f( ]
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " M/ m; v; V. N+ ~
   : \2 o$ B+ p( L# @3 M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ ]6 g$ i* v9 D   ' y' G1 F  Z  s$ i4 ~
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% n6 _' O+ P; Y1 }   1 T" R* }* P$ M* n  i
  Request timed out. & N% b# G6 N/ a; v1 G
   ! ]% x& J. ^. w, y
  ……………… ; u; y" K9 [2 i& Y3 E
   8 A1 n7 B2 d) y9 J
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& O# c# x  A9 b! B$ U  
; e0 d& y# f4 E! b/ }8 k& E  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 j% }7 B6 m: ]/ c+ s8 C  
5 d4 G. O, e% ~9 V) z0 r2 v6 ^  Ping statistics for 202.103.96.68:
, q  U' K5 M: W( [& y   8 F% {* c8 v7 @! M
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 8 a1 M& b4 p; K5 a9 G8 Y
  
, Q+ J, h3 v2 w7 w7 D  Minimum = 40ms, Maximum = 51ms, Average = 46ms # m8 F/ g1 U* D2 n( q8 O$ @
   ( H/ `6 k8 Y. d0 A: |
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 / q1 {  c$ ^, @9 V& R9 c1 Q
  
7 _" a  u8 A( ~% h, _  -l size Send buffer size.
! l) z* h, @+ Y+ ?' [. i: h  
8 f, ^' b& S7 y. O+ _' ]  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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