|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 9 h# e& ^- V5 S: I0 ]
/ x/ l8 |% R$ x6 @2 l0 d. N 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
c/ k/ C& q9 N) G 6 f$ B. y4 N/ @( K" b3 U
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 2 I6 @8 q3 W: o- [. M1 \7 u: |: ^. e
- P7 o+ {, E+ o1 k6 k
Options:
3 p1 C: S: k( r5 f: `9 I , _+ }0 Z9 L2 c5 k) {0 s
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! J& K6 ?6 l" p% I' }7 _6 n# `
6 I- N" b& s, w& F 不停的ping地方主机,直到你按下Control-C。 $ {# P$ e7 |5 r
- V$ m: Q. [3 L& T 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 / T/ X ]2 y) }/ w! h; K9 |
* o8 V& o7 Z* N8 A
-a Resolve addresses to hostnames.
+ s7 p; Y5 w' f% r
' l& C4 L7 N6 w9 C7 T! S& A 解析计算机NetBios名。 7 S* m/ P1 n2 U$ X& N
! H t$ d9 O. d, v% A4 J
示例:C:\>ping -a 192.168.1.21 ( l& |1 W: V6 s/ n; P- i9 A3 x3 p* B' q
9 i1 ~7 c- m7 h Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
' [* x1 B3 u+ B2 S
5 [/ B! [ N7 {4 z9 q/ ?0 Y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + q; n- R: B) m% C% `' I! ~( ^7 G! k
2 j+ f9 s$ H% R* }* }: T- ? Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ H9 M- g/ V; A( a' D* h . b0 }4 `- A* O9 U
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, r9 h& h8 T$ t* Q' s& u& }; Z* N3 x1 u- ^9 l5 _
' z4 V! N9 M5 W) V- R q; k4 ]; Q
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ m( U# A( o. \6 o+ Z5 f) R$ t
- X# t6 P$ H$ O: m: L" G6 k, n& ? Ping statistics for 192.168.1.21:
+ O& s; O; Y1 _% R, k' M; o) V: i
$ q v+ }7 ^* l3 A9 s Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 ]2 h/ T$ C% N# J
4 t! m! \8 I0 e. {7 ~ t4 [- \ Minimum = 0ms, Maximum = 0ms, Average = 0ms ; r5 Y V; _& p1 X
3 B7 r' W' i8 I) p+ K6 g
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 d- n: |5 ~" ^. H* N# _
/ ~2 b" ]2 u: ^" ]+ C* u
-n count Number of echo requests to send. 8 X5 P, y+ v8 m* W
+ |8 m- f! B& c5 |' c% J8 R7 L8 n 发送count指定的Echo数据包数。 1 r6 V- O; S9 R" k" F
3 u7 F: c E4 e$ G- G 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; J2 c' c$ u# `, R- n. s8 P
* ?: y6 \) r* B: _" { C:\>ping -n 50 202.103.96.68 $ s/ ]* m4 G, d% o/ L
: d8 v& Z) _) _5 G Pinging 202.103.96.68 with 32 bytes of data: " `) W* J" W1 i( z, Z( T0 |- D
" M9 W$ B& ]+ n' E$ `- W
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& n8 L7 z8 ?7 E2 O) c . H1 ~8 @2 c1 I/ i
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 c+ b# V' v% I6 f, b# G
, Z2 a {; j x* f; }! g Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" Z9 ^ `# m+ A4 D0 ~
, Z, q4 b- i. A) U2 M Request timed out.
6 G6 W' _, } d
. W% F2 r2 T1 }4 d4 X6 [ ………………
+ h3 c& U$ w0 J
6 s, t2 r7 V4 j, ^3 X* p Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; j% Z \) r6 p5 p+ S3 ], \8 K% r
' ]6 y' @/ `! X3 ?$ E! i Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# Z/ B f* y p' Y6 U: J# M% I 7 ~7 ^2 K8 J5 a
Ping statistics for 202.103.96.68:
" b& W- h0 T. l/ ^. O$ ` U : H" s g2 I5 [+ A
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: : h$ c! r3 y! K5 c) M( e3 g R
6 ]! @: K' n0 G
Minimum = 40ms, Maximum = 51ms, Average = 46ms 8 G) q5 u! ?% m B. A. g7 E
( E7 D2 V( k' J
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
, |* E+ r. w& P% X- e- O 7 ~, @1 t( w( [/ c5 `4 M
-l size Send buffer size.
# _$ T# h7 f( p! Z3 L
+ V( Q0 {7 h9 G& o: W3 b. }: v 定义echo数据包大小。 |
|