标题:
教你正确使用Windows的Ping命令
[打印本页]
作者:
野人e族
时间:
2008-1-27 22:16
标题:
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
1 m Q* N8 _' H' O& m6 ~3 `+ g5 X
9 l! s8 E9 e# H, F
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
' v* _ u& {5 t" K" @
, R: o* O8 A4 u" U! q' @) 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
) c, g# x5 @$ T8 M: }9 C: P
- D# s+ I& o& ^" J9 v
Options:
* [0 g& X2 ?* @8 H( W8 N |6 s
4 s2 E" O9 H5 U5 m9 ^0 J
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
7 j9 C8 c2 J+ f q. M1 E+ r& w
/ Y5 _5 @ \3 B7 ~# O, t0 R# A
不停的ping地方主机,直到你按下Control-C。
+ c7 K9 B$ d5 r
1 J$ p5 `' p' }0 ?: M
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
* o: {3 X! O* o1 }
1 s3 u1 ?) J. d& Q
-a Resolve addresses to hostnames.
) F* ~. a: \$ X
* g9 q# q" X0 `1 K( l
解析计算机NetBios名。
1 u" ]6 F, K: \2 i/ u' X
, \8 ?0 ?9 U l0 k6 w" @
示例:C:\>ping -a 192.168.1.21
% H1 I, ]/ U! M w( r3 }/ Q. X* N
3 E3 y) {$ S9 ^8 d/ D7 L
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
& p5 L4 k; B* U; [0 h
4 S2 D: V7 A+ K f0 T7 ?3 o8 u: L
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
|& H" Z0 O$ Z& Z
# n! d1 W: K* T& \# M1 Q' s* B
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; a* N2 i% j' t$ w6 k
T6 J3 u- J) I O
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* o2 n- q# i0 I# P4 Q
" H; _' X6 _) y2 ~
% v$ L& y7 ^" ~. r) g
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
a3 X: S# g7 o0 a5 b, H- B0 a
8 Z9 _( B+ S8 L) ]1 H/ T
Ping statistics for 192.168.1.21:
: ^5 e" x* F, f" k
3 J! y1 }# G1 `9 _2 t
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
2 I1 L# p8 }3 I& u" ]. t
3 v9 R& f) e6 N1 I
Minimum = 0ms, Maximum = 0ms, Average = 0ms
/ Z1 \! y( q$ w+ g4 P
. R% r" {/ H2 t: r
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
( h# H( O/ N( B2 |& O6 E
$ z1 K3 E0 _. N+ ? R: Q! V
-n count Number of echo requests to send.
. `. v- z2 a: E4 n. u. s1 k' |
2 y d! o3 `& f
发送count指定的Echo数据包数。
+ @$ C* }0 q. y1 ?& n7 P7 s
+ t; O1 q, t, H+ @( p' b
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
2 v9 P+ [+ N3 Z' Z5 [% o
0 N1 F2 C8 H0 F$ z4 K7 s. |
C:\>ping -n 50 202.103.96.68
. ^. D+ f. j. o! a {7 V' s% t
. {0 O- f6 a' x
Pinging 202.103.96.68 with 32 bytes of data:
. r( k% W3 e( R" j# f. Q% K8 o7 q% Q
6 g2 {7 T2 k) ]2 Q4 |$ W9 u' U
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! X+ Y+ j. F6 ]' [; k
2 ~( p2 Y A! \. P
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 |9 |2 X* V1 q' L) y2 C5 N y
R* m& q2 ]+ {+ }$ o
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
j4 @ g: g: j/ ^, v3 V
+ y8 Z6 f* u* X' r/ {/ g0 H' o- D1 N
Request timed out.
" j, e. p; m7 P' ?% }
6 p/ a( f6 W2 p4 A
………………
+ F& @8 B- E8 r. v
1 ^* o) O/ s3 G1 B
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( u2 O9 M+ P9 d2 m' s: n1 R$ a
+ \' B+ o2 m2 Q2 {& G$ @
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 u7 g; A+ v* \: v
3 _' d& M" p6 R4 T& `6 \* F3 K
Ping statistics for 202.103.96.68:
# y8 \+ Y* k: g
& V% q" T( j- c
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
% }$ j# W+ e; N' p0 G- f, s; [$ w
6 Q& x0 M- `8 [, P
Minimum = 40ms, Maximum = 51ms, Average = 46ms
* u, [ T8 g. L
5 _+ b1 \* h: x4 {$ u
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- N9 Y% W: T9 Q: ~" V
# D4 L: r" j: d y+ E
-l size Send buffer size.
& V9 ]7 b; H6 F$ Y, { o6 @; p
6 n+ o* H5 u8 q& U8 g1 L( R T- W
定义echo数据包大小。
作者:
冷雨清心
时间:
2008-9-25 15:54
强大,但是我看得不是很懂!
欢迎光临 捌玖网络工作室 (http://89w.org/)
Powered by Discuz! 7.2