返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * o3 C+ B9 b9 f  o# }' C
  
& @5 ]: ]0 i* }# b3 l' B2 w  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
- a* M  Q1 m/ F; ?' _. b  
# i* Z( u* I2 W  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 ; u1 z; L# l1 t& I: d. ?- u3 b
   9 s1 e+ c2 q7 B
  Options: & Q" |' T; u# S  ~
   . Y* r6 b! J8 _+ ?" Q9 \
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 4 j6 e- Y0 U! R! x. q5 P
   2 K  P/ O; n: y) L2 e, U% ^  ~
  不停的ping地方主机,直到你按下Control-C。
, E* O  x2 D7 ~$ v) w   , l# U2 }1 E7 A& r& j) T
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
; x& v( q% k5 P+ w   # R: l' r" G: q; l* v
  -a Resolve addresses to hostnames.
4 X7 t, o/ X+ Y% ^# V4 F7 f   / D: C6 h4 l& q/ h
  解析计算机NetBios名。
; e  q& O3 Z) W& I   # g. P  {* Y" |& i; }
  示例:C:\>ping -a 192.168.1.21
- W- e5 l0 o) C! Z( u4 o* G  
7 o* C  z3 d3 [  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
2 C) E; \4 U: M- T  K  
3 E3 a$ D7 @/ O7 ]  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# {  S% r! i' `6 J   5 k" |& W5 z2 y& j
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 [: M  y* A, }9 i. g1 \* o
   ' G4 W( g% `9 n$ e" R5 w+ k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" d7 Q8 X' q& A  B7 }! W" U& g
' h! |8 I( U8 Z5 H  ^   9 j% s% s  ]( p# c; {; F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. G8 c0 u2 v' G  
- g  z6 t  T* Y# D. W, j% O) L( |  Ping statistics for 192.168.1.21:
; L' c! V  X, n+ a   - w6 F! V4 U1 f
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
/ b2 D; `4 X" s! C$ [2 I6 h: P  D   6 M# R9 s& v7 s) n" e
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
; z0 f9 j8 m. K  
$ c3 E* q" Q% v' N+ @  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
* a" f1 o4 F& V  
# Z7 r& i# O2 |/ x0 [  -n count Number of echo requests to send. 6 b2 t# x' ?" y) R9 H7 u. ~
  
. E$ B- S; |5 C: s! s% m: M$ w5 [  发送count指定的Echo数据包数。
& `* ]2 q5 {7 a2 b1 g6 W. D   0 S( @. s/ M5 W  ~9 D
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
! c$ {& O; Q. {: L* B   4 w# i- E0 G- n- x/ v
  C:\>ping -n 50 202.103.96.68
: G( F6 j( o# `+ G8 C1 n  
( g1 B0 }% ]2 H/ I  Pinging 202.103.96.68 with 32 bytes of data: 2 Z) D3 y5 f/ x* r7 ~( O
  
1 h/ G! S2 Q4 ^1 Q1 L/ T  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, Y- ~" Z# Z( ^  
3 h. L4 Y% v" D- g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 K  l  i) S' W
   3 K  I/ C" a. j. p0 V5 n* k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / R" t5 L. p+ u
   # v# s. u' T# f3 N2 h' R
  Request timed out.
# O" c4 X6 X6 c2 ]   2 J" ~  z3 g' a4 w2 y2 w. s8 ^
  ………………
  H- g5 d/ W: V$ j6 x/ J; d   : e: c, x% j0 P, \
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 W+ r5 a7 W/ M. Y: C7 p; s
   / d" L; H* ~+ I" ]( @9 w& R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * y* R7 L4 O' g& p' q+ V
   3 o, g4 w6 h- N, G, W4 D. s5 p2 o
  Ping statistics for 202.103.96.68: / Q. @4 e2 c4 U  {1 h1 i% N
  
9 l# P3 ?$ t1 C4 i# F  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
% c  r1 j0 v. U- y   ) p, ?, x6 L! F& M
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 4 k* @) p4 A+ Z' o2 h: o3 H
   ; j$ G0 d' o$ H; O
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
6 x- x9 N8 U( Z* ^% |  
& S/ Z$ i4 e8 C0 V  -l size Send buffer size.
7 M& r! F/ Q& ?  i* m  
/ [4 Q/ J7 r9 B8 i5 @  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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