  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
( a; ^7 M: K/ S- Y" `
9 ]; d. m- h2 d 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 7 }7 @" f8 w" a- a
* N- P4 h( }% l/ S6 V
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
6 ~( Q. U* ]1 e6 b; y0 j
2 F, r [3 C8 [6 @3 U2 \. M& j Options:
, E& g. M# _# m3 V, ?3 ?5 p
4 j5 [( ?" k2 W! t1 y' ^% I( }- ^ -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
, W% f7 n% c* |& X* M) }: p6 R! r ' | g: T9 ^9 Z1 H" t% N' O, b
不停的ping地方主机,直到你按下Control-C。
: F7 a2 z( z( N" E/ m! F) Q* k
% n* @/ h3 X+ ]3 R7 I 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 R/ E9 C" d, M8 T
; i. g9 U1 B3 {9 F# Y' g# E
-a Resolve addresses to hostnames.
. l( \% ^" }4 I5 w# P( g. ^
6 O! S" u4 f' e: c 解析计算机NetBios名。
* i" Y* q* A% I/ k# O2 ^* P9 [% B& D ; p }* W' `. R2 k8 F0 a
示例:C:\>ping -a 192.168.1.21
1 N" } d9 g+ W, p. q& e v4 z& f$ b 2 j7 |: Z, [% {1 E: z
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ) U% v/ H1 @+ A3 L4 ^
1 ^4 Y% k* i1 @
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 k3 i6 ]4 R: t( @. X7 R
8 L1 q7 p$ [. o! W
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # |1 X0 B8 E3 G% n! Y1 b
# O& H: }: d5 P/ H6 W, T, f }
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 @0 H% e; s1 `( |8 O2 d" Y
" M3 V) z( M6 T0 i- ~- X) j V
4 l. x$ j9 [9 O1 s7 E Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; f, R( q3 g8 a" @
. K" o" f) R: v" Z! {, J! {
Ping statistics for 192.168.1.21: 7 L6 _/ R' J6 }$ N. Y
% B1 c3 m" m- P; E; q2 Q K9 p
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
A k) f; o! |7 U " ~* Y0 c# ~! t, \+ x3 Y
Minimum = 0ms, Maximum = 0ms, Average = 0ms
$ c% i# _2 {7 |6 [% g4 i% e 0 @1 c: Z* p4 L" l4 U% y
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
J* q; a) b6 q0 d' f 5 ~* y; Z5 N9 S
-n count Number of echo requests to send. ( h, X9 q$ I0 e) M7 B
1 d7 h; d4 k# i5 o' r+ j 发送count指定的Echo数据包数。
- n1 L6 Q2 C5 j% e0 _6 U
1 R3 G4 E- ? j- U2 r1 T8 c' Y' {3 ?' x 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
1 ~% n x& Q G7 p8 p- f
* n/ U0 q# z7 w) V% ` C:\>ping -n 50 202.103.96.68
9 A- |( D! [( M; b4 F2 l 6 g2 Q# |/ C: s) Q1 N/ F+ }' a7 B
Pinging 202.103.96.68 with 32 bytes of data:
4 v1 d L: k5 A& z9 c5 R1 {- V
% p9 \- Y( _/ y! ~ k+ a3 b Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 Q: i( k/ k% x. ^1 I2 Y2 f ; r3 S- N, u: }7 {; C
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- r1 r; w3 w; i% }/ A3 @- f
- \2 j) I) f, u: K W1 U Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 `: {8 L8 b( \' w, ]5 U
7 L. g! L& o$ F, L* O Request timed out. 0 `; d8 p' H2 a6 y: j
$ I6 `9 o3 U$ d0 D0 A2 [2 ?: l4 c
………………
9 Y* d! N6 @ u
) l2 W* E+ |6 n( k/ ^- a: w' j Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 j5 d9 Y$ M+ j) f5 l% H7 B9 V5 @ ! \! V0 z D3 @1 v/ a( G) E
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( i, x5 {' v4 D( {1 a
$ w& x$ J$ w4 C" n1 a2 @ Ping statistics for 202.103.96.68: 5 h7 D: z, O& K. N, n
0 c5 b# W8 o- J+ p5 u( N& C7 [
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 3 V3 N! I6 f0 p' G
" c9 i% I/ S% {; Q; u Minimum = 40ms, Maximum = 51ms, Average = 46ms
6 i( Z9 {! D0 X, Q
- M! i/ u1 R3 `; ` 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
5 B: E6 @* C# B* S: n % j) I" }8 B. F9 x I
-l size Send buffer size. ) E0 P% l, Q2 e3 Q+ s
6 {( ^/ i/ }0 |
定义echo数据包大小。 |
|