返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
, h/ i5 i8 k+ W/ y   6 T/ k. Z( K0 r+ o1 h
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
' r4 R: G* \; e& E2 @  
+ x% X' \4 A+ y7 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
) s5 ?+ P+ M; t  
+ \2 G% _7 J! V) I( Z( H  Options:
& [  E6 `3 t8 g( x: V   7 r7 K  U$ @: g4 r. ]8 p* X
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( \3 v$ Z8 v; a/ t3 b" }0 V
  
. a0 [  R! @4 J' I+ A  不停的ping地方主机,直到你按下Control-C。 ; R% n0 E" o5 z6 H! X! P4 s
  
, K6 f6 o7 V+ a" d  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 6 a  S5 i$ M$ J( r
  
* B+ o" B7 V" m% ^2 q  -a Resolve addresses to hostnames.
4 M+ ?7 ?. s- e# B8 |/ C0 U! [* [  
6 ]( a, O9 ^, x* l  解析计算机NetBios名。
1 c0 R- m4 F" l- G3 @   1 ~5 @2 E; d( I+ U( f9 v* i
  示例:C:\>ping -a 192.168.1.21
+ Z' v7 i5 y( d' x0 \  U   ; r' a. A# [$ I3 Q. o: J  L
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: - Z- S4 u! N* W
  
5 C: h/ R; v1 x- D5 }, W% w4 N% |/ J+ _  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & i  n: `. U! b7 b, a5 x
  
2 }4 O! d2 v  U0 T3 ~  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* a+ D- H1 a* ?; B1 R& T  j* R3 V  
5 {& R; W6 X# E2 k- J4 a  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - Z; \! g; _( [0 w8 a; t7 F

: {7 A. j$ p, o3 e3 p  
  V1 ]0 b7 c6 T3 N/ l  v, L  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ P" N! r' b3 b& u, V$ O& g   % R/ O  J4 R: `6 U! l
  Ping statistics for 192.168.1.21: * V$ C& A3 d6 B
  
/ s  }5 h& r8 k0 R  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
; P3 I. e" u# X- ^0 `# y8 U8 u  
0 L& p6 R* S' P; p  Minimum = 0ms, Maximum = 0ms, Average = 0ms
3 C! _) p- ]  \$ x4 ^! j  
' l( h& _5 S9 I% h0 A  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 7 x- F/ {! c# D7 d* C
   ( a, C/ i- U0 c8 C
  -n count Number of echo requests to send. 2 ]& V, N# C4 p  ^6 _* ~0 g
  
2 V3 O/ k: w8 R' }) L' e  发送count指定的Echo数据包数。 2 A( o5 w8 r$ G9 T
   0 k0 X: j6 e& o4 R8 {1 X
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
1 [3 q9 \1 E1 Q0 K- p  
* i, }) U' ^. Z- A6 k  C:\>ping -n 50 202.103.96.68 6 t. }. S7 T' h5 [, X8 f
     h. _" i9 C; R5 L0 y0 B$ G, y
  Pinging 202.103.96.68 with 32 bytes of data:
/ d4 Z0 b' o- w  Z! q8 n" q  
5 p* J& J3 ~$ {' ?6 a9 Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' Q7 J& ?4 U) }1 O; {
     _" Z/ N8 s' w- J. z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- l8 w5 y! a0 e3 s   - V( D7 F; j$ t3 ?4 W/ p
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- h) M) c  \" d: y, Z1 e   ) ^- F$ b" N5 U/ o, i. _- C
  Request timed out. 9 s3 H: S1 Z- A
   ) w& D! i4 a% a7 m4 N4 a
  ………………
! c# O1 r& D2 c/ M! u; n   6 `/ b' Z! Q1 f' j! P
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# l9 [! V9 a" w. k* U6 t% a   8 I; Q& {1 x' G/ }' B0 y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 ?  W/ a7 C- C   9 E& E8 D: k0 c; S: v
  Ping statistics for 202.103.96.68:
( E) a1 D3 X4 P# D  
0 V* z) j4 w, |; j# V' y! j  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: , u) N  U, T& \( C$ J+ D5 D
   , B5 ]4 j' X6 q: k% u: B
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 4 T2 {5 n1 H* D+ m6 |! m* Y
   ' U: g% j4 T# E6 n4 ~
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
% A& n5 D' A9 ]9 q% J   1 ?/ M. G0 L4 b! ^+ L% x. v+ b7 T, j/ O
  -l size Send buffer size.
. F( A& v( V( a5 j2 [  
! F6 O7 ~, x/ X# g) o; O  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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