返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
2 [  F$ M4 d& \" S* S  
2 V; U2 P2 Z9 N6 j  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: / s6 t9 K% A1 i: u" [0 o" Z
   ( q7 c( D7 m, o4 u/ z  l
  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 ! B* D: a9 `& c" e/ w; Q, l
   % L' u; n" ?. T1 I4 z2 ^# ^. a
  Options: ; {8 z3 [- t! Y6 g
   4 l4 f" t/ S) x/ k6 x2 \' j
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
/ @- }+ T( y6 @1 n' o   * N0 F" D, h1 A9 S1 P6 W! p, I
  不停的ping地方主机,直到你按下Control-C。 ! e4 K, q  h" G# ^* S! t' ~
  
* \' A, j  V0 J) w' ?; p  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
6 u: O2 U  l1 |" i/ H* e  
! H! `5 l4 ^& a( u5 m; O' z  -a Resolve addresses to hostnames. ( I  `* z. k, i* B
   * A3 C9 I$ t; Q1 j# V+ B
  解析计算机NetBios名。
$ H9 ]) h' p9 [: {0 }) j+ @$ g  
# U1 O6 t) T$ }( J$ @  示例:C:\>ping -a 192.168.1.21 7 o+ G0 ?5 E2 D, P2 e
  
2 j, i" ]  T; K4 r  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , Z% M) D0 `) `2 I9 L
   7 d+ p& t3 C) }" v1 n
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 _" D* o( l" j  
$ A- O/ j/ z+ W) ~- N  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ X3 v; f1 [8 k: A  
( Y8 N% O! _; [3 ], C9 y- i" W( U  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - k9 D, M9 w' c" F  _6 K

& m8 V0 n# ]& `  
, v5 k) Y9 q: Q* M$ b, w9 x  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - H8 r" m: T% V' ?' d
  
8 z2 Z, z6 m6 j8 K7 M  Ping statistics for 192.168.1.21:   C9 ]6 S/ P) c' Z. j, n/ \) A% r
   + u4 P" h( {0 `% ~, y: i
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
6 H" q# Z2 s3 z4 k5 H8 Y   # `+ P! J. q/ k, i8 D" Z
  Minimum = 0ms, Maximum = 0ms, Average = 0ms % [1 ]7 J8 p6 u8 C
   ; d+ J: b/ z( X" [8 a4 [- V" t* ~
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
& j0 u. u9 m' `) c, |   1 i0 C  z& F( V
  -n count Number of echo requests to send.
- ]' I% `& y' Z0 ]  m  
6 ~! h1 z" h1 Z: l0 Q6 Y0 {( r2 x  发送count指定的Echo数据包数。 0 X1 _. E- o- E* o  Y( `, Y: d
  
$ \4 L' W. X' X4 K8 f, M  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
0 ~  h$ O1 Z8 R  T: ?  
0 q2 {7 b/ x: c6 K4 N: e# b# T" O! I  C:\>ping -n 50 202.103.96.68
3 v0 s- U) Q' p2 t  
0 {" d7 z- P. j- z: {6 c  Pinging 202.103.96.68 with 32 bytes of data: 8 ]% Z1 j' N. ~2 G2 Z5 k" w
   ; s. V* n/ T' @9 }* f5 I9 M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& K5 d/ t) A! V! I# V   ; X. Y( i9 r* K9 v9 q8 ~$ y' ^
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 P7 I; i: ?* x' ?  _! f   % s4 G% O% M' N/ `) X- W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; F" D' V. o; D0 h4 K1 }   ! l4 Q/ }  c" r9 P1 H) N
  Request timed out.
0 }, Q1 I6 k1 }% t, G1 H& R     q, {; k* O. i* k9 T3 E. P$ G
  ……………… - M0 o$ E0 [; a4 l! b
   & \/ f% m8 h8 J8 f1 a& y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 f- j: ^: ]6 H7 G3 J$ Q& g# M
  
; b; M( }* ]7 n5 L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 I; T0 C! Z$ t7 a5 O   ' p! E2 i/ |2 [6 y  P. V% k
  Ping statistics for 202.103.96.68:
. T# T/ B. y3 E: m3 y  `   1 x8 z4 K& o0 X* B+ N5 h( Q& V
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 2 ?3 i8 F3 b; Q$ ~4 ?
  
9 {( I/ \0 G8 _# a/ u, q% y8 c& [  Minimum = 40ms, Maximum = 51ms, Average = 46ms
# |4 o' t. _6 ]3 T2 v   + w! X1 q; K" K
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 " F& j0 `  ?. L5 B2 v
  
' X: v& B9 }. u# z* \. v  -l size Send buffer size.
5 M% n/ N' ~" X- l* \   6 z* L2 q  O8 \+ f4 `9 t) \
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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