|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 8 M9 z2 X# }3 M! D8 Z0 g+ C( }
/ G* l+ `( p& t U' [ 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ' v3 o* m& \6 \5 o+ x/ p! v
6 B1 [" j: l: 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 4 ~0 ]& O3 k. v* H e
2 |: e5 d* ?$ w" G9 M
Options: " Z1 h, a5 x e% ?5 s9 x. l
- U: f; T/ i5 ^) r* }# M4 i; y+ b* G
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
[ \+ W0 P. O1 g 7 H |" X! g- b7 ~- T& n
不停的ping地方主机,直到你按下Control-C。 ( ~- m1 J! D N$ S
+ f# V$ M) C- Y) a 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
2 H& h, i) d5 ]! p1 s 6 y7 d/ ]1 _1 }
-a Resolve addresses to hostnames.
. K1 v! a) R: t
q0 c) y, L. ] r 解析计算机NetBios名。 : o: g2 P# [0 I1 O4 {1 q. K/ a* _# H
4 n# x6 l( {: c5 `$ t
示例:C:\>ping -a 192.168.1.21
. k7 Q% \! Q/ C6 j # z% p/ A5 @9 T; y$ j8 k
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
; D0 u- {; O$ d8 }7 {5 r' O ( ?9 b6 @) w0 ?
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ H$ M: v4 L% N+ W1 @1 G
" |# A- k' p. W Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 Q7 b. L, [& L8 F- u4 Q
9 y$ J& ` V) _8 d7 l7 F" x Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( U: a5 s5 K; ?" x% @$ Z8 R
) V; Z8 m' d3 Y+ F* [: _ B
4 v# [, a$ Z2 B' y
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; C6 H, U2 m) u) h
5 B* c# V: N. a& @- R Ping statistics for 192.168.1.21: : k; |9 o* f5 g
# J9 f$ F6 a6 J2 Z' L- k7 h Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 9 |7 V3 N! `1 { J& a
, y% i# p/ s2 n6 |3 O" H
Minimum = 0ms, Maximum = 0ms, Average = 0ms ! I9 W. \: t9 m. W7 m3 }
& f" C1 g4 u. e6 f q 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
! t e. } O' P9 D- }8 X
8 A) f; P! A" w3 m -n count Number of echo requests to send. _" Q4 f1 Q7 B" a' L
$ n. i4 S, @2 _$ ?2 m. ? 发送count指定的Echo数据包数。
" o$ ^7 m9 Y! T3 o& h* P0 N( S 1 t8 n" o5 i N/ G1 _
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
. h2 j# Q, z% \, H( S/ ~
, n1 S M- h m5 X$ S! ~( z C:\>ping -n 50 202.103.96.68 7 w9 J5 W' y* v- b
; E" S8 F9 H+ m: ? _/ B4 G7 @ Pinging 202.103.96.68 with 32 bytes of data: ) `/ j1 Z8 c: s
, a% n+ w) u1 O Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 f r3 t& b8 k5 o2 T& t
3 b G/ {) P' v- [ Z, U$ }- n4 ~
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% \8 w) p: S) o; Z G; D: D" E % \% S4 f+ Z, g$ }2 r
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + v) O$ @' O/ ?/ `5 M4 x5 v% o! R
6 d f, \* z# z0 N9 R
Request timed out.
; _" z6 _" O5 f- H6 \/ K6 @2 f H6 E0 _
" l, h' j' T! b4 C ………………
3 _1 p) ], E! [. v1 q9 A # m& d% T, O% }" V2 e4 \! _
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * k ?4 R7 a6 H% _: a2 a6 d$ \/ V! P
# l' A% e) r4 l; L* F+ j Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' |/ n/ Y- E6 S E
8 z0 y% V( }: i$ c. B& u$ ^ Ping statistics for 202.103.96.68: 6 V7 y; \6 U9 `- Z- F2 v/ ^
3 Y5 P6 B3 N4 ?
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
9 c: Y) Y2 t% X! B( p1 n" t7 o w! C ! c: @5 C& c* l1 }$ d: A
Minimum = 40ms, Maximum = 51ms, Average = 46ms
1 x* c; Z0 I9 W0 V1 u- ^& R
" t: N1 B" I3 q& _; O1 l! @ 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
e9 p: P/ _& A* ~: ^$ U ( f6 A: m1 y/ Z( Y* Z
-l size Send buffer size.
+ \) z1 j ] _ ; X+ o3 D6 c7 q6 o+ o. r: `2 K
定义echo数据包大小。 |
|