返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 - B- D: B0 r, S
   & h3 T( |, w5 S0 e0 G$ a
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
& X; l1 M: M2 ]  
# m; p/ Z/ L; M# k) E' p  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
# k; Y9 S( K# y- c5 Z$ a   2 `+ F4 j9 y# i* z
  Options: * _: Z( {- O& f' h0 a
   1 c- G; d, Q% H" T+ O' b. C( @
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
6 v8 [6 P* U: C3 n   ) U8 w; ~. `) f
  不停的ping地方主机,直到你按下Control-C。 6 {# k) V  b6 ?5 g
  
( R# |! D: [. F, z. f  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
* O: D: Z4 f  Z7 ~8 z  Y  B   . {& ?2 Y0 ^& U$ l
  -a Resolve addresses to hostnames.
5 o) k9 w) L0 t  
6 T! }; _( \4 I6 f& O  解析计算机NetBios名。 0 c3 E# K& a; [6 ?
  
* n; T" I  i& S* z  示例:C:\>ping -a 192.168.1.21 7 N7 L* }+ c9 {% l$ P4 G7 X" N
  
' i, Z1 K, q* l6 f( E  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- }# N4 k- w( I5 f% L   , O, i+ A0 N4 t
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ m8 P  ?* v4 u% Z   6 d. y; O" Y  @# d1 b
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 L* C7 F) r& f2 y) j% Y# e7 r
  
( T* f4 D: l  V3 b  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; m/ _: b6 {: ]& ]

3 k9 F7 o( a3 T# i& `) t% `. \   " V, V" C& v% @% C9 Q  v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 I" b/ }: Z$ R; C& w0 r" Z: X
  
1 D8 h/ X% p8 ^& h# ?  Ping statistics for 192.168.1.21: ' f8 w: S' s" y: Y; R
   + P8 x5 M8 @- H5 i% q
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
, }% z6 w6 Z3 O8 O   8 o. p4 D- i7 N
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 6 ~- @6 _: H% D
  
7 y8 ^' R7 {6 B) d5 N3 r, {, l% d  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 # N' r2 i8 b) @/ N6 `0 N
  
; V7 i! b7 {: O- y  -n count Number of echo requests to send.
: v& m1 n) Q  S7 A3 {- K; s  U  
: g6 \* _* Q5 T- ?9 N, ~  发送count指定的Echo数据包数。 ) b' n/ u) N" V( H2 V7 F8 I
   - E8 g: \) k- l$ }+ h; H3 R7 j
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
/ m; E$ S; N6 @  
- R, v" ~7 D) q  t; L  C:\>ping -n 50 202.103.96.68
  {; U' I) c: }& ^; u/ D! B   ( I1 q$ A! Q. `1 \
  Pinging 202.103.96.68 with 32 bytes of data:
( o5 x% K9 ^1 k) e5 L$ {  
. P- @3 o, }2 p8 h* `( ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! G" W+ `- m3 C/ Z2 w; @, `
   * I% s" K% Y3 C$ p( l' z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' q% ]7 F: V3 ?3 a/ v; k: _' m/ Z# `
  
" |. Q& ]( y  j$ Z* s& V  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 a2 d9 f9 t, b0 ?1 o- ~
  
; k6 o6 N6 L  h  {3 \  P4 M  Request timed out.
6 S( ]0 D$ |: K+ I  
+ L% j1 x) F0 [' y: Q, A  ………………
* {3 z# t" g7 i6 i5 O0 Y; [; j  
) J1 G! [- Y3 D5 f0 {; n7 h. \" X# p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; I8 V4 y& H; x8 l/ n   3 ^: x  }* {) u* K6 g
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 j5 |! W; H0 `: U: y  
7 L' A- O: F& W8 Z, Z7 `  Ping statistics for 202.103.96.68:
! T& \2 p1 R/ C- ?  
7 \. R2 f  Q5 V! C  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
  ]6 t6 o* l! }8 g  
# L. n' h) X% W: d) J  Minimum = 40ms, Maximum = 51ms, Average = 46ms & J& B2 Z4 x5 \) q
     v+ f) x3 m* ^' I8 i( k
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
0 F2 {: {, @- d" x  
2 k3 M0 H$ `- R3 U0 A  N# Y& \  -l size Send buffer size. & |" p/ I+ ]! k' L, L3 ^! R" i. U
  
3 M0 b' U0 \4 t; `9 q; {2 h  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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