返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 5 P! F) \) U2 W, a7 C
   & O/ K9 a. U0 g( C# K
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
: i5 M2 P2 ?3 }& Y   ! X4 S* N7 ^) `$ ?& t, z8 Z
  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
" K4 C* t7 X. c" `; T8 J1 m   , p  w) @4 B7 s
  Options: + H" J% ?3 ~& F" f/ P: b' r7 t* h
   9 T% ]  M9 H2 H
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.   e# Q* `& H/ W
  
, c- S$ J. V4 r2 p: H  不停的ping地方主机,直到你按下Control-C。
/ C" W# ^* P4 ]& W- t# u  
( X! N/ r- V9 ]! J  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ' W% x8 c" J. @% s& O- e
   1 V* |* m+ {1 m! f0 m
  -a Resolve addresses to hostnames.
( m  W- Q1 G& m# i! k4 E0 L4 Y9 q; c* K   . b+ h& U) t8 d2 P1 \4 k
  解析计算机NetBios名。
, {- w5 G, r# s  
3 \  B. e3 M! r' H& E  示例:C:\>ping -a 192.168.1.21
" l  F1 Z, K5 O6 |9 I  
" i5 c6 @- f- u/ R; O. g& u  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- H2 i. I$ n8 S  
8 D' ?" i) r: J1 u5 N( I& }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) p$ @% ~& a% i/ L' C: \* Q1 E3 `
  
! {6 @! u# ?, p: ^. j7 w1 k  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# ~/ m* u$ [, o9 C0 }& L: U  H5 G   . H' Q' c$ G- ~: W3 ?" A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, i% F; w' @& q
  [; D& x0 q" d5 s" Z: }   * z; M+ N+ |& T3 r3 T
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 X7 L# i6 U) K& I
  
$ d1 g/ s4 v! L+ X# v0 x( ~- A  Ping statistics for 192.168.1.21:
0 Y  Z: [, A) g; y: w7 a. f/ m  
; \7 o+ m! y$ T6 `' V& z  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: : @2 _( P8 A/ {
   ! F2 B7 z& a$ T* g1 o
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
) ~1 M/ C, l1 B+ c  
+ _5 _) H9 j% e  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 & q6 T" e. H# v
  
+ B* D! w4 z* w" h* |! r( w" z  -n count Number of echo requests to send.
1 k  h- U. f1 `$ i  C  
  R1 B9 P/ ]" y5 o& Z  {9 `) t  发送count指定的Echo数据包数。
$ m. I" @8 ^* E; b8 u$ }1 \   7 z7 P7 T  P& h6 Y" l
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 8 W9 Z) \& h5 o. h
   0 r6 W) U6 F5 m+ U9 q4 s" S
  C:\>ping -n 50 202.103.96.68 9 S2 }9 ~6 j, Z* M7 T
   ; R$ @2 v8 I" l  Z; I
  Pinging 202.103.96.68 with 32 bytes of data:
- O- \; n) a6 |( ?6 |   - W: K5 r$ V0 I% l; S
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % s& e$ ]' ]' d6 I
  
: ?. u+ V/ G7 A  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % e0 I- O* ]* J9 A0 Q
  
( d7 O5 L- ^. \7 A( _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 P$ w' R! I. c9 D, y6 A   : F2 G9 p6 a" D8 H! d: f% w- I
  Request timed out. , }  o1 H* \6 o* C/ z
  
/ x* \' n  u/ u' |) Y: E  ……………… 3 P8 u: E& P# o: Q: C, q
   / g, S2 g. W5 m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * G: E. p8 C  k
   1 F- @9 d. n* j! C. z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 d( ?/ H0 W: K% S3 y% H
  
+ X3 j" v, T( S; \  Ping statistics for 202.103.96.68: ( V5 v0 S7 _- b  @1 a# g9 |
   0 x* H0 w$ l7 @4 v- v8 @6 y
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
+ @: n  r' N* u   1 _  q) x& [" Z& f3 Q' D" C
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 8 O/ j9 c3 l4 q: B% q0 ~  i
  
* R% g! [) K5 j  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
' v1 A! F/ M9 e, s5 w2 [3 Q; N   1 k, C; r/ _! m' T
  -l size Send buffer size.
- m) }  x9 J# s# D' s  
( `3 d& o: ^! h; ~, [  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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