|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 2 L) @4 ?. H& P2 C5 {
5 ?$ D8 S! u2 q. O+ x 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
: S- B1 g+ [7 O! n) v* h }/ a6 g* L/ t* x9 T8 U
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 ?* d' ~/ c I1 h
. o. r. f# }8 L8 R Options:
; P9 a; L9 M1 v+ i; r
; O& D: i" L# |/ `+ B [ -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
' U+ a% {" X- j( t. V# K* u* E
4 d6 m3 r! y( {8 F* U: w6 j4 A% C 不停的ping地方主机,直到你按下Control-C。
$ S: L7 H& I6 l( H: W. ]
5 v! F1 Y0 ?' i. i0 f 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 + I& ^0 _. d5 p& L; T
, p& a3 b5 r/ M( o -a Resolve addresses to hostnames. 3 M' X+ q4 x) D: h4 v, G! i1 x$ e
4 V( r3 W6 u A/ S6 E! X! E
解析计算机NetBios名。 $ d( x' T8 z9 F" N4 @
8 y5 K1 y# |0 o# Z 示例:C:\>ping -a 192.168.1.21
6 c3 O) }- L2 A3 { ( f/ z8 l q8 T h0 j" |6 ] F
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
6 `" P6 q& A# i# }) N6 S% a
: U+ a2 P$ y# {" ] Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - N$ ?' }' N' b! K
- h. Z6 A2 I2 q9 C# p+ h5 G Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' x2 I& u$ @8 D& {7 V: b" x
0 N! _/ }. q* o' k3 F9 M+ g% J: }; p Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# a; w2 Q! ]6 l7 ], a4 X6 \7 P0 q, w1 D* t% ?/ W
$ \0 Q6 l! r- @& x Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: {- a5 u* u- O( m, h2 r
8 t& p; V+ m9 ^1 ^+ i8 O" a2 x# @ Ping statistics for 192.168.1.21: - H, n9 |( \* c! Q9 F' P
- A8 A9 h6 V1 `4 S1 A
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 4 ]1 W2 e2 {- ~' T3 c: n
/ v; k `" u' {6 q# f# f5 }$ e7 O, q Minimum = 0ms, Maximum = 0ms, Average = 0ms 2 f6 H7 d% [# c/ s: H* w# R
5 a& @# s, w& T% F
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
: Y7 c$ O2 Q$ e$ O0 |1 R ' i& V. n i) |. d9 M
-n count Number of echo requests to send.
- `" ]3 A% _( p4 t
+ D' t* H6 d* i' R 发送count指定的Echo数据包数。
; B+ l* X4 l4 C5 r Q! U% [; [3 O2 [9 K4 p3 `6 h
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; y1 X- g9 {: ^- p, t- K& |
( c6 r- F4 S3 b! [ C:\>ping -n 50 202.103.96.68
5 b4 e% O0 m" |( ^
) {0 {1 F) d/ o) t; v+ }1 G Pinging 202.103.96.68 with 32 bytes of data:
+ l% o3 H! _" e1 n2 y% x + F' W0 P2 l5 a6 l$ l
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 k4 b% ?) O# Q% q) G; d; ^
' w* p; e0 n: j* R& R* J
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* U+ U5 @9 ]6 D5 j% B% @ / P, |7 S+ _+ c/ l4 A Y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) s7 U8 G0 T8 u. N3 Q
1 t7 K$ i3 K) F. f Request timed out. % Y% `& ^% B; f
% `3 M# ~9 a3 ~" @, @+ z ………………
5 C l+ L! H% T" O 0 L6 f0 C! z/ T9 C ]4 q
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 @* I, ]0 c- p
( u4 ?# m! D5 b* q/ o( f Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * I3 v f1 ^5 D% f! V% u& C. u
1 G+ m# z+ N5 ^ Ping statistics for 202.103.96.68: # I+ Z' @$ \$ K m, K5 P7 @
; ^: _9 R. R) x3 `) @' b
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 4 }! H, e) S0 H0 e
/ ]- J$ ^5 j. D
Minimum = 40ms, Maximum = 51ms, Average = 46ms
1 j! ^; S# t- K# Y7 ^* P( H0 z! Q$ |
" ~. @) ]* ]) x5 x5 q 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 4 A G/ T* O* W" A4 \
: \5 k8 T2 ~4 V% M, }4 z
-l size Send buffer size.
1 r( }4 q/ L* S3 w * W! x, Y6 w R8 P) {% L/ ^; ]
定义echo数据包大小。 |
|