返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
- |- w' V) _2 Z7 }  
$ i5 H% _# s( X; J3 B2 r* L' y  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:   ?6 g* N8 ]6 _3 I( I
  
3 h% D" c& I/ {. S+ S( `  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 1 J0 V( T* r) _; Q
  
3 p; h" N) }$ e+ `3 u( m& h  Options:
6 O0 G. u5 s/ E# o  
3 \+ r$ _8 t$ ]3 s0 ^  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
5 k/ Q! ^: X+ y% @/ }  
& S5 F7 X& b# [! q  不停的ping地方主机,直到你按下Control-C。 2 q: `4 e4 |5 k: b0 V. Q4 b
  
0 J- l& J# }+ `" c5 [! e( M  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
  e- x3 _9 S3 }" h   . ?* n; i/ L  A* p7 l1 J% c2 r' Y
  -a Resolve addresses to hostnames.
; M, j, j$ L$ g: b   ) U' n0 Z1 g  z7 z
  解析计算机NetBios名。 / _& `7 A  w! w0 w& x9 Y4 T6 J
   3 x6 T, e3 n/ F* J$ m# B
  示例:C:\>ping -a 192.168.1.21 ( g: l2 h. Q( o" b6 C# r! J
   + \2 S  S9 n/ m$ x3 I) e/ E6 ~
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 1 ]' R5 \  a8 B# x
  
; y2 }6 f, F# `3 n% e  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 T$ s1 u! X( d  O4 b1 G6 j3 L   4 _5 {) X: f: k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 W2 g% s) D3 d! L" f     q. B( t6 ]" B0 N1 G9 j: O
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % \2 R3 h4 }$ m
- G. N5 {& E- @5 G
  
$ |# }) c8 w" C: u$ ^2 m$ t4 T: \  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 t4 v: s9 X0 @& f' ]$ t1 t
  
, E# Q6 O4 k- @& y: T$ ?; V  Ping statistics for 192.168.1.21:
6 B1 d( \3 e2 F& r$ x9 f, X   4 T. |' e& ]( }  C
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
4 s$ c4 ]3 O% q  
) D; m5 {) q  x# }  Minimum = 0ms, Maximum = 0ms, Average = 0ms 2 u  S* B4 y/ j" P8 d- K
  
: F8 \7 G* F6 m, Q! i" k  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 / W$ b! i4 ]8 t" |- m7 {
   / i# v! z" N( h2 b+ \+ Y
  -n count Number of echo requests to send. + b3 w0 L7 o" D; t% d
  
* j  O; v/ V/ L% ]  发送count指定的Echo数据包数。
& s* Y1 b8 }; N5 \6 l5 s- p  
* i  E* \; {1 ]2 \4 V  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ' K4 R7 G9 M$ F  X- M' G1 f
  
- C( |* W( }! R' A: Y8 n7 t  C:\>ping -n 50 202.103.96.68   t( h2 a, c; p, v
  
. _# \! ~$ s+ T# |7 D! n+ ^4 }, e8 N  Pinging 202.103.96.68 with 32 bytes of data: ! N7 Y2 D" m) f2 J1 B% x# R
   3 P6 g( S- D+ M) Z' O5 A; @. k" V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 Q/ \$ T. ~3 S0 e/ O
  
- Y& d6 _8 Q! o% u9 z0 `  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" X0 [" H& q3 W$ W0 a" O2 R7 ~  
0 x  Z, z' V. H7 Z6 ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 j: R9 I2 h0 u  U, m- j
   . o0 _7 g4 c5 Z) W/ T
  Request timed out.
8 [% C1 |* S- [( i. L8 M$ u& R  
, R# E* n! H' H. s; l5 I) C  ………………
/ Q! f. A+ r5 n2 H9 k   5 G3 b7 o* s2 Z  p6 p: }" {
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ w7 {! U3 V4 I- N9 [" G; u4 V" {  
1 C9 p7 `3 W9 |) C: C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / ^8 @4 e2 g; J+ l( T
  
6 T4 a& n& ]1 n  Ping statistics for 202.103.96.68:
4 m8 m% l4 Q. A. b  
- ~2 A( G4 {: I9 e/ h  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
4 w6 G5 \& Y7 B  S" b) ?  
/ \6 N8 D( o, U" L: Q% e  Minimum = 40ms, Maximum = 51ms, Average = 46ms
* G* b8 o' o" H5 B( m  t   ) s! M, M, k: L' `; S4 E5 v
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 & L" r# I5 q+ |$ C+ r4 W4 q) ~! `. @
   6 U) `. a, D# c
  -l size Send buffer size. ! F9 H  |& _- w9 z4 o
  
0 q( M: [- ^$ e0 D  o$ P  定义echo数据包大小。
89w.org捌玖网络

强大,但是我看得不是很懂!

TOP

返回列表
【捌玖网络】已经运行: