|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ( }' X y! M7 A
6 d8 J. q! u4 i9 x
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 6 i% s' B" Q$ u+ W2 X c8 G9 ?. M
( x: j" O5 x3 U9 Y, s1 I
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
! J+ Q% W7 Z4 A) k9 ?) o - V A! g0 v0 A" a& w- n& r
Options: - T5 p/ k9 X8 R" Z: ~8 \/ l ?3 ~# j# ^
# `, l" H, t5 t5 r! z7 m -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( H% s) g" @. O, a+ w9 t
- U1 L4 `# j3 {, g+ X; w7 I3 x 不停的ping地方主机,直到你按下Control-C。
" }6 S4 _+ h: L. V7 K6 D 2 e1 j6 G+ N( T+ x6 i# z
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 # l# f* V7 b& L4 n4 ]
, w3 v' P% h4 y& L
-a Resolve addresses to hostnames.
! U3 H! L0 L# e7 t' ~6 L
& I. a9 W$ K9 z9 c 解析计算机NetBios名。 ; F1 @: \% p2 z1 O9 s7 N; A
/ i: D( D3 B3 `: H1 X 示例:C:\>ping -a 192.168.1.21 . Y/ \# ]# M9 k) z: k* T
; p' v6 p4 [0 c- m% t5 k c Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
; r) U* M" v1 l7 C# J$ H& a
, Y" A6 O" |, d Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + @( A0 q( w0 K* [6 B
$ W+ m8 \) r$ R0 |* N
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # R% M3 G! Q; j/ Q# g
0 }, Y# y0 P* d8 X# P j) y t+ M
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 P2 \; r0 `8 K
- D v a7 Y* a4 t. [! x
- M0 g4 \" l% ~6 s Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 j( }5 b' D9 A* B
" I7 e% ?2 { O2 A. J. f2 U, t Ping statistics for 192.168.1.21: ! c" U9 S+ B3 K0 T6 J. U
8 N' C& n4 y: q' ` Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 h% X$ Y* V5 C+ D
7 J0 K; P8 m$ k3 C5 D+ @: U Minimum = 0ms, Maximum = 0ms, Average = 0ms 3 g" w6 e* J% {
1 o( S2 z0 P) B
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
) ?# B2 j+ D) F7 j3 q2 G2 z: P 4 ?8 @/ j. g% L( f8 r7 @& L
-n count Number of echo requests to send.
% p( K: O& ]6 N" {+ r k9 ^) P 1 d, L6 b9 t- O- g' n" e& y2 s
发送count指定的Echo数据包数。
0 o2 A9 ]8 ~& R' O: b1 J * L q9 i$ @; H" O
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
5 C" g2 \2 _. M" @
9 _/ [/ i, S+ D/ e- N9 E" X* Q C:\>ping -n 50 202.103.96.68 ; g3 s2 V! F% z* k: t
3 G2 A. L" J6 M1 x. {4 O/ {
Pinging 202.103.96.68 with 32 bytes of data:
2 y# L0 C3 `% u $ \) o. Y; q' Q5 d3 ^2 h5 R: E: y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 z3 Z1 s5 K0 w3 W5 C " ^3 w! K* f9 ~5 y. y5 t, q0 X1 o' i
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) s& u; p* S; S2 m# j6 E
/ z9 c) d& m' G, U- z Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. O$ w0 {0 x5 J
+ t' f; A2 `" A- X Z% ?3 t Request timed out.
, E; ?3 T" w4 {1 _ 1 i, y0 b1 J8 @5 ]; O6 `3 p
……………… ' J2 N" ^* I& _" o. ]. l. b
! \4 Y7 i( f, i+ h" W' y; x
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " C5 j- ?$ S$ `- j: Q
) D) q3 {/ y2 x! E, b
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% _' [8 J* v+ {3 X. a3 J0 ^, {: S5 w
. a- S+ k& I( W. X7 Y6 @4 h/ @ Ping statistics for 202.103.96.68: 8 t% Q8 w- `( W
. I6 n: {; Z O: p! Z: g
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: % y0 A5 p- A1 H7 M
2 D6 V, y' F% d9 l& v6 @( m
Minimum = 40ms, Maximum = 51ms, Average = 46ms 7 J, V& u6 |' U
3 z; Q2 P& `+ J& B 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
9 F6 C/ Q! A- d4 T1 ^
% d0 ^7 Z; P3 N* K& l -l size Send buffer size.
8 C& b; D, z2 \0 B) z2 j" k
: M7 E) M3 o$ X, ^/ c9 Y 定义echo数据包大小。 |
|