返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 9 ^+ ~* I, g2 ?5 e; l
   + ^/ l+ \' t' w
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
: j. b) J3 j' A  
! ^$ F" }' l8 D9 g' N* \; Y) 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
/ v+ W9 L2 B+ n$ r# L" j$ S  
1 c5 v- S& D& S- c  Options:
  M+ v8 q0 y+ [   ' K! Z6 u- f0 ^2 l$ @
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. . K( U! P; \9 s8 L! h0 @; W% z
  
. c4 e& z7 j8 G5 N  不停的ping地方主机,直到你按下Control-C。
' @+ |; G5 n; A8 ]- n  
/ Q$ m7 o: a8 J. Q  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ) R- c2 H8 j( h: u
   ! E  N% @" S! e, F6 N& [
  -a Resolve addresses to hostnames. , j5 c8 `' T- K1 S
   8 L: L2 q3 `+ R7 w, q6 O7 C# l/ M. u
  解析计算机NetBios名。 8 I$ }6 R! U4 ^3 I; B0 `, G  i  K
   % p1 w3 e4 c5 {2 ^2 ?
  示例:C:\>ping -a 192.168.1.21 # ?, b9 a% K# L& q
  
! F2 X9 Q. A1 v6 R7 F0 h, S4 ?+ W  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:   o7 d- O" ?: ~/ a% L
  
6 Y4 i1 F  T$ U( F6 Q# w: r2 |  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 L2 z& q- A* V' ?+ V% d9 D
  
2 W1 F9 N& s9 f+ X! P. @: [6 ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 F+ c% X) M" ]% c
   ) n( A1 G9 H1 ^  z4 V
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( V% X2 ~: h7 B- P1 @) R
* R' f* R5 `0 O. ^9 K' Q
   7 u! k* k+ R& b7 C$ Q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' u/ ]2 ^) j/ O% M( F! j2 L+ f9 l  
# z7 {5 N( J' `" t9 u8 a  Ping statistics for 192.168.1.21: , C5 d. q( m5 g
   ) h1 o  z: P$ a6 U$ z
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: & ?- M) F6 E4 m
   9 w) b, D9 p  B# u9 W
  Minimum = 0ms, Maximum = 0ms, Average = 0ms % ?6 j9 \6 T/ z" s  z
   / J" O" e9 X! y% k2 F! m( o
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
+ S. m7 w4 H6 u5 C* X3 @. {% B, y  
/ C- F  h& w) Q: z7 |" Z& R+ N  -n count Number of echo requests to send.
2 o! j. x5 r7 |   ! ^2 j) J# i. u  X" R! ~! ~
  发送count指定的Echo数据包数。 5 S: d& s8 u0 `8 A) i5 b
  
/ B% W; q6 p' }0 ]; V, [  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: : {4 B: n/ [8 y0 S9 v6 D
  
& c9 U3 H5 m; t% C0 q- q/ `  C:\>ping -n 50 202.103.96.68 . T- F( D& K! }# K* \6 [
   + ?( Y* f! G, V* C+ Z, ^! a! C/ j
  Pinging 202.103.96.68 with 32 bytes of data: ( u/ x; e8 w! `$ y
  
( b. Q% U" ?5 V( N6 o- a& }6 [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 ~+ B3 E& C1 F' @4 Q" b   2 w3 S. }* `9 T$ g# \
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 u' Z/ I8 m, C3 ?  j* G* P. Y
     F' k$ d6 x0 m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 n$ t. `: {! G) Q8 m) i3 Q' i
  
5 U  g. t' u% @# \* B  Request timed out.
1 v; b: q4 O, j( N   : D* h8 i& Z' c  e( \2 m
  ……………… / d0 X$ C+ z* E$ E( B# L
  
$ D- \6 z; D( A9 D8 Y9 F2 g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. w% [8 h$ D1 w& v! n$ y6 I   4 E3 `! I# a9 V: }1 O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; j; P6 o% i$ U' }
   7 _/ F8 |! @: C4 |6 G/ b, |
  Ping statistics for 202.103.96.68:
! y  {+ f! t3 d3 g  
1 @1 D; Z+ r4 ^4 f/ U3 |& T- V& J  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: % I, n+ O1 F0 S3 `4 O  o
   6 r" B4 x9 p% C# a( b! q+ s2 K3 n
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
3 h& V5 ^# X! W  
7 D, S# i' k# x! S" A1 W8 o  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 3 |, I8 R, x# t8 i( |9 n
  
2 v8 U! ]- n. l" J  -l size Send buffer size.
/ Q6 |6 g8 q* G4 r     n- M/ ^- V8 Y4 p9 ^: E5 U+ J. f
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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