标题:
教你正确使用Windows的Ping命令
[打印本页]
作者:
野人e族
时间:
2008-1-27 22:16
标题:
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
8 j; s3 T0 p, c' m6 ]% @
3 n( M" a5 n4 j x
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
3 S* z9 R1 A# {# u7 y' ~ P
" Z) w" K7 l L, k8 Y- \5 H' U/ d
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
9 j, N2 s, s, j9 v+ x/ K" x: B" M
& C- ]. O7 t% r3 O: v; a0 M5 V( t3 ]
Options:
e; ]/ c7 |2 W. N2 O+ b
7 p# R" y3 f9 @" P( l
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
% X5 e) _- O4 D0 M) i4 I
% n! z& z# I$ P3 N3 |6 q
不停的ping地方主机,直到你按下Control-C。
( `. l/ C: T9 _5 U- |0 p- Z
- w) a* \' I# F* y2 `
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
8 X/ B, W0 v' ?+ ~
. X; K' o3 ]' v. E0 G
-a Resolve addresses to hostnames.
$ g7 v% f) I6 A% ?. o; ^6 j
3 J! f- Y# V) N) {8 N F3 b6 c( h
解析计算机NetBios名。
' ^$ d2 F& x/ r2 d
: {! m! u4 A) U1 G m
示例:C:\>ping -a 192.168.1.21
+ }1 f& K6 O; {: I) A
% k! ^% P; n, A
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
; Y f, ?% |6 ]1 s: O+ m, |
0 v1 `3 `( O- {7 T) X
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! u, d+ N7 a/ c/ S9 Y0 j4 U
m4 V0 S" t8 i& j
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 U! I- |4 z' A% i/ b
! c8 J& J% T3 R! o' x
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 @8 W6 o1 ?, h9 V. S; a: H1 b
! K" C2 u; ]+ i% X2 C. l
( \- f7 _" n8 m, F
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ w$ u- J* H+ y
$ Z$ H) k. @4 h/ g
Ping statistics for 192.168.1.21:
: W3 s1 R7 l" _* z. t
, y8 V9 r) D8 S! X5 l2 N
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
: o2 ^2 U1 D# L( t# ~9 l3 o
. C3 O6 k, F0 L# h% Y
Minimum = 0ms, Maximum = 0ms, Average = 0ms
7 J8 y4 q+ D1 n/ Q: P. `% ?
3 l& {9 n6 W% h/ v7 H* W6 o
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
C$ ]7 J+ f# @2 b( S5 k8 G
" t& v9 P5 F2 _+ L
-n count Number of echo requests to send.
, Z7 ^: Y: O( O7 }; U, A0 O
) e5 L' B2 f8 z) K, G
发送count指定的Echo数据包数。
2 {: r+ f3 ~; D1 w
( A6 ~7 W) l- F2 N' |
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
% z2 b. l. m0 R" `2 U, U( \
; Y T0 O. Z# B' q8 V6 i$ L
C:\>ping -n 50 202.103.96.68
# n! K0 o" W8 p# g+ H) N/ _$ h* e: z
, S6 Y3 J" d- X* q* Z
Pinging 202.103.96.68 with 32 bytes of data:
) h1 A5 [1 v9 j2 ^4 L. o
' }8 X% T0 \6 Q" D
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
H. o" `( g# R% R% M
: p$ ^* N/ ?, P' D/ E& f/ y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- e! I3 x u& x" |/ `& L
0 y+ D4 c' A" N0 ?- c
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 c2 K* l" d, T6 D
s1 {* ?5 \- M! _! t' C
Request timed out.
! r, q" C6 b! @' {4 J2 U
# |* x* h [8 b- i3 c$ H
………………
6 ~* F4 Q% `8 s6 w% Q
! S. e1 L5 C: T G
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 u6 Y# @' M) r0 N" J
; z i2 X* X8 Q0 _% |' Z: \! C
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% G, _! G" V v2 k: A
4 t3 f. y3 ?6 N' o9 @' a* t
Ping statistics for 202.103.96.68:
7 [' M: y: c0 ]* w
# v' s: G8 ]7 Z: R2 n5 _' U9 \1 x
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
3 |( \% p9 ^! ?( Q0 W9 y7 `8 @% ~
8 s+ q3 {& G% g( r
Minimum = 40ms, Maximum = 51ms, Average = 46ms
1 Y" C! l9 Z% |8 ^7 T7 |1 Y
2 w- h: J6 W" r. q0 [0 | F
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
6 ]1 i8 x4 `0 ?8 T2 p9 O% [3 N
: N. t" @3 @) @; I+ L$ |3 a
-l size Send buffer size.
N! F, {2 K& U0 y. S
0 s6 a: b$ w. r$ k/ b' t" O
定义echo数据包大小。
作者:
冷雨清心
时间:
2008-9-25 15:54
强大,但是我看得不是很懂!
欢迎光临 捌玖网络工作室 (http://89w.org/)
Powered by Discuz! 7.2