返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
) B! ^  M2 V# }   0 q6 |& e9 U6 H7 p
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
1 b  C( \/ B9 B( F  
; W* V$ a4 l  y0 ^9 ]1 R6 B$ K; f$ X  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 # @" k5 I, Y: e, K
  
: R' S- |* l* G  Options: % ^: m) j9 i. J! }
   ( z4 F3 ^7 C  T" V2 i: u
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. : Z. {* O9 D; C; g. X( v
  
' N4 n  t! ~1 j  不停的ping地方主机,直到你按下Control-C。
; L" Y1 S3 o. D, c6 v" c  
9 s, h5 O1 x' y& r, d  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 1 k" `3 t: O0 n* a% s' `4 O
   # B; N1 I6 e2 y* e
  -a Resolve addresses to hostnames.
1 J6 w  U3 W" h8 P. L  
) }1 Z+ ~% a5 d* t- Q  解析计算机NetBios名。
" w* s% \/ w! {3 i- ^0 W  
, M! e- r/ b# Q% Q  示例:C:\>ping -a 192.168.1.21 9 O: N* ]& S# q' z
  
8 S! v- T/ A! f% j3 h6 a3 |  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
: r* R+ ^% b& Z8 N9 @  |( ?" ]   . S3 k9 B* _5 @! @5 h0 U
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . k# q8 D8 |6 J0 a- W
   % `6 k  @+ R. x& o
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( w) V, ^/ e' \+ K! L+ u8 X
  
) C+ d  Y5 Z5 S# o. m  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 T  n/ x% W/ U0 _% D% i$ L; D6 C5 i8 E7 f: Q- W& S) o
   2 a+ i: Z$ e# X( }# Y" l$ z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 b2 c4 |1 R9 `   0 \2 v0 H$ N. ?( v& f5 P6 k
  Ping statistics for 192.168.1.21:
. Z1 h5 u3 a5 a) ^$ m7 k   " N) T7 N! i; Y% W; e+ o
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 x, a1 D8 s" l) i9 {& [9 {
   . [& O, V$ U, i" H1 e' r4 S
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
, b9 T! L4 |8 C/ |9 Q- C* x1 n   7 t) j( E; u* l! E" r' y8 s
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
) y& }! j6 S6 k; S7 |2 T  
- {7 m/ m0 w& r  -n count Number of echo requests to send.
) }% U: \/ E  ~( L  
; @. Y; z5 ?1 C8 W  发送count指定的Echo数据包数。
0 Z7 O2 E5 _- m: t* K# q$ O  
: a! Q3 F; V+ _% }1 A, y$ R. ?  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
/ t1 b( Y1 X, [. i  
! |7 r1 H0 j6 I. p, |* v3 l  C:\>ping -n 50 202.103.96.68
/ O5 @* `& s" u7 `4 c  F1 j   9 t+ J6 Z# C% i/ Z/ ~& O
  Pinging 202.103.96.68 with 32 bytes of data: 2 b1 f5 X. G7 H7 R) r
   7 N1 w7 c7 ~. r; J
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 J. q4 i8 L8 n8 Q* ]9 i  
9 p8 M. ^! d& n9 c" B  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % ?$ {) u& w8 K) |: E1 u% v0 y% @
  
, I, Q8 L/ N2 E5 T% S  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 m8 I) c' Q" L/ w& L2 G" g
  
* \3 S$ ^  }! c# m  L0 Y  Request timed out.
' F& U. j4 t0 Y4 x" ~, Y   % p1 S& L  ?# T
  ……………… , p* ^+ [" u2 S; m- ~
  
% U& |) K: B" `7 l8 g" z& v6 C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 R1 ~6 V( V9 w0 [' S4 w5 ?, W
   + A; \! n& e: @& W" y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' O7 ^5 z+ D- ~* [& h
  
* |) q  M8 G; U0 L$ F0 Z  Ping statistics for 202.103.96.68: 8 W/ e4 V* T5 v( f: v) w
   ' c% {6 K. ]* y' W$ m8 j
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
( Y( N# B% H* W& z  e  
- h* Q" O6 l9 r: ^% ~/ D/ y  Minimum = 40ms, Maximum = 51ms, Average = 46ms 2 V% G1 _$ }/ a- X; e6 [( i
  
! `) C: U" R2 I& N: j3 E5 {  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 " u$ a, z! Z: @+ a2 m
  
" y  B( d" J+ s9 j  -l size Send buffer size.
0 F7 U' Q7 B* n! ~; X8 o3 s   . n; {) P3 `( n9 X3 B3 p
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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