|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
0 A0 s0 ]+ E) T4 |7 a% L7 g9 Q 1 J) G& j/ D& `
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
]' n2 y9 r' h5 H
5 l, T: L2 z/ B. F" U5 _ 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
% G S- A+ V3 Z9 k" c7 J' z / e; |* J! n6 j2 y n3 u/ A* L/ Y/ Y
Options:
& x% R5 u: I& I" z! c+ F; T. Z
: B0 K$ h3 o2 n5 y; v M F: R -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
+ K- X6 q- k* `, T - n, n. \+ }5 Z
不停的ping地方主机,直到你按下Control-C。
( G3 [+ w! R4 M& o
& o/ Y+ h/ ~$ W# c% a) J: Q 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
8 K3 d% V* F, @, k3 x% N4 \
, d0 [& } k5 Z; {% d/ g# C -a Resolve addresses to hostnames. ' S/ ^: d4 C: U3 R c
: V8 r9 N' a3 O+ d! |6 H 解析计算机NetBios名。 5 Z; L8 a" m$ K7 v1 O2 z
. Y: u. `( V) Q/ |' u, A/ f
示例:C:\>ping -a 192.168.1.21 % s$ S" G- ^! u/ O {
$ ~7 z- L9 ~0 {! w B
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ) v/ b! r% t A4 b5 x
$ T0 m/ [. ^- z$ n Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / s& [/ e6 S, ^3 u: ?5 [8 H
$ j( _- d7 A {9 f# I Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 G9 x q$ D; g4 X . H* e( X u# m9 n% R$ k' D% E3 ^# O
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. q* o( o! R! ^& H
- A( j5 B" Z6 z6 ~
# Z+ c& e; S6 R- j7 }% n: l, ~, s Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 k# b% L3 n7 A% S7 P
, h4 T7 } D7 w
Ping statistics for 192.168.1.21:
* ~* ]9 s; q' _6 d) i + z' y% J' f7 }8 g3 N- F3 [' F- P
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ) E& S; D& t) ~( B/ W- O
, W* d ^4 m- x# F$ a
Minimum = 0ms, Maximum = 0ms, Average = 0ms
4 w" E' z" }5 {$ | $ {+ d3 ~ P7 k6 x9 N+ N j, o) ]
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
% k; X8 y' [0 r$ K
; d; B4 r' C- w- A, a# q* v -n count Number of echo requests to send. 5 b2 B4 l) I' x( B1 r" s
e# u& G( r4 y. A$ N' w9 p8 E
发送count指定的Echo数据包数。 , M% C1 f1 O: _, h
- U+ Q5 o1 B- v' q- n
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
7 q; j2 \# O9 W r$ r + p% L# K, C6 S. k
C:\>ping -n 50 202.103.96.68 4 C, s: ~5 W# W& x% |' E
: E7 j- w; n4 Y( Y
Pinging 202.103.96.68 with 32 bytes of data: ! a, }. R, f a4 [8 y% _+ v+ H% w
. T6 D" @' F& f+ h
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 g a6 V2 {) j % q. x( q( Q# e' a3 C
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 x+ h: h+ c4 b# M ?' W % _8 m1 c3 t B. T9 L) G$ u
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ D/ \0 h, J3 M: j6 Y 6 K1 f2 \1 e8 @( g
Request timed out.
& [6 j3 y2 J1 J/ g( V0 { 2 Y( B! i& E" T8 D
……………… 8 w( i9 K* U- ?3 c9 G* [- v! ~3 a
9 ]- ^0 i$ N# D4 I C( f
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( t+ ]: ]1 k2 H. @5 y
% y2 x5 M, I W5 D; @ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! M! J" F& m' I* d# ^ 0 h6 h( g N. c4 T0 p) h
Ping statistics for 202.103.96.68: 0 ^& v) w8 o+ g# z8 }% v6 {& M
% n' V' X3 e8 l `, V. k Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 8 E R" Q# t4 a, V* V& r9 V
: v; D) k& t3 d1 \3 k- |2 u) X
Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 `/ D5 h {) ~) V- m6 Y( a
6 L4 N3 j" H( r$ h W$ W( A+ M
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
9 H, _/ l) V4 c7 O9 I
; z- R! M2 D" Z -l size Send buffer size. 5 Q5 \4 y4 ^4 k& \* d# f |
. t- T( q; Y5 D8 J$ j/ Y0 I
定义echo数据包大小。 |
|