|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 . Z: Z/ J; q4 D2 B* J, \
% O0 `! N" Y* J, A) G 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
/ w) e6 Q8 }4 h. ]' V
8 ]% q( i& s4 l' L' h1 k 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
( m5 y v f9 w5 E$ f% E3 Q3 n
: u0 B X0 R; A) u5 D# r' K Options: : l2 U& a O8 |& r8 J( K4 q
' Q5 [, e7 k" a# t -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 @- c9 [: p% r; @' q
9 \; u" m9 K6 [$ \9 c
不停的ping地方主机,直到你按下Control-C。
" ]( E0 I5 p# I ( F7 V( s. r+ r( J |& l8 s
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
* Z4 l9 E/ P. {- k5 Z2 Q7 U
5 s' ?# _/ t ~# i -a Resolve addresses to hostnames. % n5 u5 z2 w7 j' l& m
. p2 B U( |% Y
解析计算机NetBios名。
/ v3 ]& R& U' G4 s
! s- [" A6 F! y 示例:C:\>ping -a 192.168.1.21
' @/ }3 F' v0 J4 v. V7 y5 Z
2 C- F; }+ ]5 } Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: " O8 x: _/ k1 u6 L/ c* S
+ w x6 E2 r$ c {7 J
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& D8 f. Q6 ]' R' z) S
$ Z1 K9 ^- n$ \. T, y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : j( Q8 a/ Q1 }
8 I1 `7 P7 ? |6 K5 y: `
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 W. Q2 a( T9 _ J
/ F2 V' _- e: J" E & p* q$ R% V2 S5 p9 Z+ I8 ?" I
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 q2 e: I$ r! \3 L; ]- D
* x9 K* S0 L1 O1 D) s& `8 h Ping statistics for 192.168.1.21: - \& d) d/ T2 K7 z
/ x; M, g! l: f* n0 h8 Z! z Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
/ ?# i5 Q6 w- i& W7 J 4 l2 n1 i3 }6 [( Y4 }, r. c. Y
Minimum = 0ms, Maximum = 0ms, Average = 0ms
$ S V1 \' W3 q/ u - v1 H+ c1 C3 f, x% Z/ |
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 r6 n* p O0 @" A
& A U8 W# ?. S) v6 G -n count Number of echo requests to send. 9 p! @$ J$ Q7 r6 N9 a7 v
) z7 I- Y( W2 n7 j) n 发送count指定的Echo数据包数。
, q) \; i% ^' b T# E7 w
6 U/ Z7 ^- _: w1 Y 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ) x% @0 L# o. S
5 t- T; H+ \1 m$ M2 z
C:\>ping -n 50 202.103.96.68
+ h+ {# B9 r, w7 ^' a
7 K8 ]( j' k. D/ u3 y+ ~4 @ Pinging 202.103.96.68 with 32 bytes of data:
4 a+ g3 P3 j. H( p 9 e/ a2 h Z. H0 @$ b
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 p, d# @+ f V$ e' H/ W
8 c4 O' W% J" h) M# U# R% i O! ]
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; b- _1 H; h$ v. a- o2 n3 T ! B' X2 w. [4 j5 r
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! N" m6 E; Z4 ^. b; I8 k* f" n, n! _
3 N: c! W% v% W Request timed out.
8 R O. B0 T* l
- ]8 h! h5 z! g: d! [ ……………… 9 U+ |1 B2 ~& F: F, g* }& V
3 ^6 B# }; c3 K$ Q Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 m' ^/ c, m% Q! r2 D
+ _" R2 x# d" o( C7 k Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 }7 a/ z5 D: g/ W, a
8 v1 g" X# ]- A9 B E" R Ping statistics for 202.103.96.68: 8 U2 f; [- i9 y4 X
% T: f! D# b5 T Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: , J. t2 x2 b, i: o9 a! a' K: X$ l
* q( \; H. R4 s! c/ d) O8 t
Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 F9 o+ y8 _4 S; f! C
) [7 V6 ] ]+ P: g
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 4 t8 j' H$ I x, d- x
9 X7 B: c7 I4 s& q- A+ L
-l size Send buffer size. 0 c8 I, s* T/ @) S, P
$ U( F7 `& `" I' R 定义echo数据包大小。 |
|