返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ; ]4 F, V" ]- o' n! i; S
   0 i$ n' o) o9 F# \
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ( m4 P( m; \9 u
  
2 M: n  F, X9 r* b6 t" M  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 : p: o" p% d( _: w' j
  
( k) B. Z! p2 t3 Y  Options:
7 Y- Q( ^/ P9 e) R  
' r! e: G' E) Y0 Y/ ^- ]' x% y  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
& }' s) u9 Q) r  V  
' ~+ w) C, L2 g1 L8 O* W  不停的ping地方主机,直到你按下Control-C。
" J7 D! F0 ]( ?% ]   0 ~8 \/ ]; S3 _' r3 r
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
; \4 y. Y. W% I% B  
( M3 O5 T( Y2 m; `6 U) u( j0 a  -a Resolve addresses to hostnames. ! l9 a& j, K5 l' D
  
3 H+ n+ `, n0 O3 u  解析计算机NetBios名。 . o! j/ i: K0 V. ]
   - k6 e; p2 P4 s; r. B( N% R
  示例:C:\>ping -a 192.168.1.21
8 [% z/ c) E$ K9 a- T& q   ' \5 `5 j6 P6 G
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
4 H- h- R* U) o" Z3 x2 d   6 u4 X( }# R3 t  J9 l$ M7 D
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! {6 ?# S2 F' Z4 K
   1 s5 C; C9 Z% F$ O
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : P) K8 h9 R3 p4 R; r# z4 Q
   8 y" S2 E; J" ^
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 G+ A, f. W- ?( }0 ?

0 S& U! U: S; C9 G2 Q   ' s9 L) c# M" \4 d$ I' L) {+ d. \/ q2 i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; b; }. o2 n+ Q  
5 T' x" X" ^# ~  Ping statistics for 192.168.1.21:
5 H8 |9 I0 Z0 Y( \6 \  
$ R# ~1 w. b7 i  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 g' [0 f8 k: R. a3 w' \5 D
   ' r0 T9 K& V- \
  Minimum = 0ms, Maximum = 0ms, Average = 0ms , F7 P, Y* h' }' [
  
) a+ D+ b" i$ U  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
# D) w7 s9 s5 ?  
; I0 T# ]* @. h& `$ J  -n count Number of echo requests to send. 7 u3 M3 s0 H) I( ^" R
   ( s9 }. m; @2 S4 v) O. ~
  发送count指定的Echo数据包数。
) Q. H. Q! f: M  
# [/ f6 w  n) i7 U( P  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
# J3 h4 n# i7 F# b* Z% K) ~   9 ]! m5 Q  k1 ?# z# t3 ~* g. x
  C:\>ping -n 50 202.103.96.68
7 L6 K$ A" q# O/ V' O6 r* _  
& n; \" P( b8 k  Pinging 202.103.96.68 with 32 bytes of data:
3 e5 P) t* {: V2 t1 B0 ^. L) `) @  
- F: i$ c/ ]* @3 R5 @  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, v9 i3 I- ^1 Q6 r) K( b   - o' l, Z! t' ?4 \6 V  ]- t
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# U) e  `  X% `% ?   ' _8 }" `9 L, d7 J* C3 {. h/ @
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  y& W! F7 A: _, ]- P4 u7 D8 ~  
# x& b5 i; I' J& Y4 h4 |* G  Request timed out. # _  c9 g: `8 e# n" _( D! `8 N% ~) i
  
: J, W- |; ?9 m% n# h& M! e8 J% d$ c  ………………
: g+ v. J9 [" E   . H  g" m8 d3 X7 A
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ P5 a) _) }& [3 E& z& J9 _* o   0 X. z- |5 W  h' y: o, T
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ H* e' U, p$ m# p7 r2 P! _
  
# ~7 B( `" `" \; p+ {. t  Ping statistics for 202.103.96.68: ( V8 U: V$ p/ ?  k9 _' G5 [
  
. K6 |' P7 a* A; [, }7 B9 H5 y  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
) ?1 Z# R' b) D  
! Y/ D9 X& K6 @/ E* U8 ~  Minimum = 40ms, Maximum = 51ms, Average = 46ms + v% h  H$ R! _& v# J8 j& X
  
0 u% R/ q; z  F+ h  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
% P: v# J) u; _+ t  U) L2 l, c. @  
& n+ ]; E6 f/ _9 D* x  -l size Send buffer size.
; j& w+ G2 s1 F, y8 j. C+ i5 |  
8 d4 K' L( d, x; E: e1 e- g  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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