返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * ?+ Y: M2 S! ~. |; x0 f9 R( s7 R
  
  P; o. {* R; f/ G  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
) ^; @" T+ J8 S. V- d   ; K' g3 j/ N8 M, w- \7 ]6 J$ u4 T1 o) 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 4 h2 \! w) r' r9 T) u
  
- u  [  x, }% [1 E( A/ ~8 R  Options: 2 P: {8 I. M# E6 N. g3 p5 w
   4 d* o9 o6 C! ?( o4 z
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 8 z( V) v9 M: _1 \" A! a8 h
  
! H9 s* |9 d! V. g6 p# I- Z7 ~& q  不停的ping地方主机,直到你按下Control-C。
* w3 b/ E9 b1 q3 y2 g8 g5 r   ( n' B) u7 r# d, T
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ' `4 f# X5 T& w
  
7 i0 j: i  [8 D# ^5 @% @% @& j  Y" h  -a Resolve addresses to hostnames. 0 n* @7 n+ j& I% I4 p
  
  ~, o8 S, w6 o  解析计算机NetBios名。
# N7 R8 c: ~2 k/ m9 F( T9 p# X   ' y7 M7 R% A9 j( u$ H( h3 t
  示例:C:\>ping -a 192.168.1.21
) n  s0 ^( L5 p* e: ^$ i   9 I6 d) [- |2 c0 |
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
. b$ p- H5 J; r# l; L6 E  
( B. Z0 T! @/ d+ M  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 U* A; h5 h( l  
1 l# I6 O4 ~7 u  u2 P8 b6 Y  P  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* H/ t' R# k' [2 s3 \  
* I9 g! f2 M& g  a, Z# p0 `  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 m3 R  d6 J; \. a6 Q# D5 `. {. \) j. m5 P) {( O6 y' U
  
8 h6 [* L. ^5 ]0 U: o( u+ y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. {8 ], }1 y2 U; r  
; u& |  E& l6 z3 T( Y% [  Ping statistics for 192.168.1.21: 3 j. P6 ^! }5 W% B
  
, ]$ w% X' N5 l% G7 T- p  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
# j" \: S4 J" a  G7 C( v   8 a0 c& H# p. J5 ^  F
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
2 D" A3 d; X: |   * x' O, y3 l3 W/ K  r
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
) d1 [9 i5 E1 s5 T; S  
" ]! e' S5 H3 W2 R( B9 }0 h/ h# I% T  -n count Number of echo requests to send.
2 f& U( ~, t8 ^, z   & c/ t$ H3 C0 S3 C3 z; e
  发送count指定的Echo数据包数。 + `5 i8 ~$ ]- ?' l' [$ s  a! S' _
  
, [# s. C: P0 U5 o4 s  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
2 b3 B3 L5 w4 R  
5 ?5 o( t5 U6 A: r# W  C:\>ping -n 50 202.103.96.68
8 L* d" e7 ]" E# |: d   & u( f2 x  j1 V+ q; n5 r
  Pinging 202.103.96.68 with 32 bytes of data:
  r' Y  [+ b" z$ J   6 ~% o- ?% H; M/ N  ^7 H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( _# B( h8 c2 i   0 q" o2 m8 r: P
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # B+ V2 I' P& V% z; a, ^$ Y* h/ \
   ; a7 L' U2 ^  ^9 C" h" Z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * r/ ?3 w8 {& c; i4 C: Y% \4 |: |! G
   * X& I4 Y1 U  D7 C3 Q& B! a2 H1 ?
  Request timed out. , G/ u( A* i2 z" {5 T8 L
   1 R9 e# e  u1 J7 N6 q
  ……………… / E) I& S, O) u( o  K* \
  
6 D/ j0 h' B, O7 p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ x1 n: a8 W$ }0 k2 ~  
4 v/ r( _/ ~5 t3 c) E: ~0 p- ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 R7 j4 p6 t" H- B, b
   : w/ r! m# i. T2 X2 u
  Ping statistics for 202.103.96.68:
/ f3 h9 E& B/ v' |6 D- q   ) l+ z' d- ^. u9 {$ S
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
" b' M9 f/ U6 f6 `' R   9 e2 \) H% x4 ^) \
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 0 B) s0 y% e/ r% a4 S6 n
   7 J& @6 p; d# G5 i9 n1 l
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ) e* W0 m4 R, {$ L& |8 G! C
  
/ q  o( M* k2 V8 t9 g+ A, ~  -l size Send buffer size. 7 ^" U! G( f- t; n$ e) g
   , A) b0 X- N1 }
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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