返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 6 A+ D6 z* F% J; a% S/ B4 @% S" ~
  
: l& V8 @. m  N' W3 y% ]- C) ?  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , n5 a4 @& G- o0 v0 s
  
- p! D" B7 S: u* F0 J  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
- Y  S: s8 x  d. ^0 S" i- f* W2 o   8 d' i) ~4 D3 B( j  u
  Options: 0 @9 o! E1 P) \1 W5 Y' W+ i
  
* Q1 O5 M" s  N* u  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. + Z0 N9 }* K: n- j( V3 |5 |' t
   $ z( b; ~' C' Z6 \
  不停的ping地方主机,直到你按下Control-C。
1 H" E" v# r8 ^1 _9 U2 j( n: ?   % {6 |# I9 G: x* T6 T/ {- e# n9 U9 U, b
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 x! s$ ?9 k0 \# ^
  
; I( L# f5 z1 I9 P; ^7 z( k  -a Resolve addresses to hostnames.
" o# a" g$ V3 \3 B2 W; r   ( r; z* o! G) c
  解析计算机NetBios名。 1 K& k( U) V3 P+ e1 X
  
8 ~+ r. y) W6 z1 U- M  示例:C:\>ping -a 192.168.1.21 # `/ E) K3 U; R* h/ d* O2 `
   9 L& z. ?2 C' s5 I1 _7 o
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
6 B! q8 `+ y* v& z2 U4 ]- g% h  
' Z0 v( ~' T4 l, a6 A1 Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 W. p" |5 M5 c  
7 `* y9 ?4 ^+ N  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 M5 O/ I4 g. d7 s/ r
   1 B' Q# t  j7 V2 ]/ O; O' k. `$ h
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # l+ O+ K/ W% Y# r1 h

6 A3 e/ z' e. Y   / {% G5 t- J: F0 ^$ M9 u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   a8 a% f! P/ s' T* f
   8 L' d& i# |3 s' `- Q/ T
  Ping statistics for 192.168.1.21: # \! E" V+ @; y8 j- c. N' N
  
+ G! S3 l( h7 G6 i# H  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
" c+ t' g0 x% w; p9 ]) J7 b   ' w; e# E. E/ k' ]6 Q( i
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
* b; k9 N8 Y5 f. q   3 A+ L) t' Z; n6 w! r3 ]
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 7 }) f; U2 [9 M
   & h4 R  \2 a5 K) |9 s$ M
  -n count Number of echo requests to send. 7 Z" P2 G" |/ M% F9 z5 o% p
  
6 l% A/ Z3 N& o  发送count指定的Echo数据包数。
7 Z& I8 Y+ i# b! d  
" R7 A/ Z" [/ n' Q% H* P  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:   d' H' L' |' q3 j
   ; |2 w* g7 `: N$ y
  C:\>ping -n 50 202.103.96.68
1 D0 a2 x. O) `! J0 k   ! p5 P7 {4 c0 Q2 E/ L  U2 w
  Pinging 202.103.96.68 with 32 bytes of data:
' |: D7 f/ h, C0 Q. s  
0 G3 R9 N2 |" H. q' Y, x" M9 O  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 }) g8 p: Q: {' r! M: {! y9 \  
3 P+ B- V6 I! Z4 `3 ]: Q0 i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) R3 G/ ?9 \2 x8 Q1 W  
/ r' }1 M" h$ b# C: S0 }  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- |4 ]+ x) r2 G- H   - c% ?- C1 x, P- d9 x# K- S
  Request timed out.
0 U. W. N- G( U' p9 Q2 Q" }; ?  
$ i$ ]: u9 m7 J2 B$ `( n" _  ………………
: H( ]) h  ?; Y: _   " p' m; n( D4 Q+ t6 F/ o' M' }7 T
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! ?( S6 A* s+ P& j0 h  
+ E" U5 l) l! z4 l  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & l' d2 g* E6 k' C8 t
   ; V$ T1 ]! i. ^) i4 t4 J( j
  Ping statistics for 202.103.96.68: 9 Y% r1 k2 z2 X" h# d; S$ E
  
8 Y- _; d- h3 l3 s+ j* m5 n% I* @  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
5 K% ~0 X+ x1 [' Y3 a" ]  
4 `9 \/ N1 w' s2 a  Minimum = 40ms, Maximum = 51ms, Average = 46ms $ F- |2 x( N: }% T4 N. x4 Y
   ( ]2 M; S7 Q* Z4 g/ Z6 p) u9 P. n7 ]2 g0 J
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 3 X& \* c% z# Q4 `+ r
  
* t% k7 C; O$ i. Q  -l size Send buffer size.
& r0 u/ g( P* f* ]6 L2 V5 G  
- i5 e* L% H) Y& E5 |% F/ n  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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