|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 - A/ ~5 Y0 H5 r8 d! c; L
# ?3 P; E" a' l* R0 N( ^- \4 } 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
5 y4 x( X4 e/ T& Q6 ^ 7 A/ o- {& ?4 |+ d3 C( e; f. z, b
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
* w, @+ v( B. G0 {1 s8 R
( Y$ O; F; c4 h: P0 C- b9 X Options: 4 k5 Z' T! D- j
0 q/ \" s8 Q0 P4 t
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
$ F8 B+ y/ k. {
( M( H t& h' P2 `$ U 不停的ping地方主机,直到你按下Control-C。 ! d1 l8 [" ]& z9 k$ O! M6 ~+ Y
+ M' ^" V6 @' {/ ~. h; O( F: v
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 / b0 g% {/ d! S4 x- D0 X6 j
# F4 k- W. s' b, j! ?1 x0 ?1 M, u -a Resolve addresses to hostnames.
" x( h) L( }2 e* J% h ; R* V, ^) A0 W v
解析计算机NetBios名。
7 N9 k; N- i, c- X
4 T( h8 M8 J& m% }' q1 Z ` 示例:C:\>ping -a 192.168.1.21 6 n) s) X8 h* U! s* i% q2 w
+ S9 T9 K( Q, Q% }" H
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , R5 ?4 z- n- n! X3 t
7 o8 s) {' E$ g8 a/ p. K; c
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) ~* ~: E) c& O
+ o- v+ O) Z3 L. F$ D s Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! z( f2 E4 R# b& V" b S
. ^- o) F6 L( d4 _ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' F o* n9 F/ U: b: c
- Y! y$ _4 A5 ^1 a' c " [, ^' i% i' t5 V# ~1 _+ P, ]
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# u" b1 z. D8 r# q c: z; t0 h
4 W0 F/ Z7 A" G. B Ping statistics for 192.168.1.21: / P$ z9 q9 o I5 X$ p, I( ?
7 g3 i8 s7 Q) V# t9 p
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
- q& _8 H3 n2 o % X1 g# N8 h1 O: ~
Minimum = 0ms, Maximum = 0ms, Average = 0ms 2 V3 x9 O5 F2 ~& t
5 _ f0 N4 i" c4 B! X4 k 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 - k' M' m) t. _) f' G' c6 `
( k/ P$ l6 p+ }/ H1 L. H -n count Number of echo requests to send. 9 |7 a6 { @) G: c5 {; }: x( N! [
6 F) E. v" l, h8 d/ g' i
发送count指定的Echo数据包数。
# E: j5 m* G3 ]
7 v- z# E0 [' ~% x" k' D5 P 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 2 B- [; O }* X
$ ]* b) M3 j# K" ?1 `# \3 {1 m4 _ C:\>ping -n 50 202.103.96.68 3 P6 w) Q1 N( N0 t5 L% j* g
! d; R" P4 L" E; w G. W! |5 ~1 @; [ Pinging 202.103.96.68 with 32 bytes of data: ( `+ I/ h) a6 _ f
# j8 C2 w% b3 Q4 b0 F, r1 s* k
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % G2 a- x ^3 i4 {! {: {
! g4 o+ o$ c1 s: o( `$ b Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 c! J3 y* E; p+ ^3 ]# `2 v2 i
" O! y$ l- P! u$ p" _0 c( P2 v% n Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * C1 M" f* Z7 } ^% z& c8 Y7 r
6 l: P& K! n0 ~
Request timed out.
7 v, b" u) P P/ j: W* g! O9 W4 m 9 a2 z' x: c4 b, ~1 Y
……………… : k( c7 V% Z1 r: E
$ P; ^# G4 B, e* @( w
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, Z# U$ y& B# _; {" X. Z
/ h: B3 X6 d0 N$ G Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; D1 k8 i. H* o5 d2 V; i0 Q$ P! c4 t! y ( J/ o3 W( C2 C3 h
Ping statistics for 202.103.96.68: - P/ v( ?2 ?4 E
/ d- {1 Z* \' q0 t! O+ l Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; m' `3 J) o* w6 f
3 l% s) h2 c! O6 ]2 U w, H1 G
Minimum = 40ms, Maximum = 51ms, Average = 46ms
, |6 Q+ e& c( q2 C8 [ 0 }2 b+ N) h$ `5 v$ p- `+ D- Q
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 : ^5 g( N" H+ ]6 S0 Q
! I) B& p H- B& c$ q -l size Send buffer size. ( N1 }. m1 q/ u2 I0 w
$ N/ j8 H: T- w( [0 e 定义echo数据包大小。 |
|