返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
; M2 M' \: u. g6 a4 x% [/ t2 k, J  
# o, N3 d( K" y& s6 ]8 E  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: & C) F* A) @( S& `
  
+ M2 C( C0 [% k8 P4 V% y. y, ~9 C  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
- S. K+ D; L7 ^7 _# L5 L- P( Z8 [  
1 c# K' {8 K7 P0 g  Options: 3 x5 D3 {$ _6 S, T, Z# Z
  
4 R3 S# P7 k2 f2 E5 B5 e  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 1 Q, a* n7 X) _
  
9 o5 s3 H4 q3 L8 \- @$ z5 W  不停的ping地方主机,直到你按下Control-C。
: |, |9 U- e8 N& D; ^  
4 |" O# c5 w3 h$ u1 ~  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 : q! B0 O& R: c8 ^
  
! K  H/ q6 I/ t& h) B) X7 Z  -a Resolve addresses to hostnames. ! z" G' L6 r6 e# @# H% k
  
. e3 f) v/ M& m/ ?, d6 |+ o  解析计算机NetBios名。
0 j. l) H" E8 C4 ~  
! f+ e$ Q6 p0 v$ D2 N  示例:C:\>ping -a 192.168.1.21
! D1 C. b! }3 }+ W- e  z1 P  
+ s# Y5 r% j. T# k  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 8 ]$ h( f& n" _/ A6 q
   + j6 }. y+ A9 ~& W! {# q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 |& f+ b! m% o   * p( E2 m0 q, _0 g1 t- q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( v9 Z; T6 s2 c) {5 S' m( I& ^
  
! E% ~# ^8 ?' o# d& ~& E" w! }  e  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ |* D: _# ?0 A% }
6 E# u# a# T/ e# J! c  
5 @6 m% v- y8 J2 Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 K& V2 @  s8 X  
& ~$ D2 U7 o8 A( N' l  Ping statistics for 192.168.1.21: & j5 q7 Z/ n9 c9 q% B( u. b
   . S" w3 C$ X& P: n! M' F) J
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
( T2 l2 w0 W7 d2 n4 d1 J  
9 ?. j) H# \7 Z8 h4 F) R. x  Minimum = 0ms, Maximum = 0ms, Average = 0ms
3 n  R7 U; q5 f4 H2 J+ ^   ! V' r& O4 F3 T# [
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
: p. _+ |/ z! v! d$ h  
& w8 @1 B) Q% a  f3 U4 h  h  -n count Number of echo requests to send.
" ^& m  v. d2 g  
9 N" u5 {2 Z# m# E  发送count指定的Echo数据包数。 8 n, {9 }% n. L/ ^1 C. b, Z
   ) y. ~5 ^" ?1 l( M8 {
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: & i& N) j* X1 i' i8 a( z
  
1 o8 Y* d! l, K7 Y. a  C:\>ping -n 50 202.103.96.68
/ ?) p1 F( |) M7 b0 T& X! \   2 E  \8 H. j0 f( c. u9 q- d6 w0 o
  Pinging 202.103.96.68 with 32 bytes of data:
  {! p: p- u1 a' E  
2 k$ l/ \5 t& J  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " R5 Z0 Y& v% D
   ! O3 T( E8 S6 T# T* z1 N8 Z3 X  S  C
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: N4 ~+ }* b8 B# P  d* j, I. |. C1 v  
2 _" d4 S' {+ i) W- R  G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 D1 h# N& f7 N/ W* i& s# ]% v  
/ \6 _1 R7 S2 u. O' D; \" T  Request timed out. . X& m8 a( }1 P# b4 k
   6 e9 M1 c' f! B# o" ?$ w9 a
  ………………
* h) V) A: S5 ]1 q2 [! i   / [" Z+ ?' _5 H: M* R# |) ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ p- c% w: e" F; k  [+ Z* d0 I   3 J. M6 C5 [, b: i" E
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # F4 i  z3 S' T
  
6 l, L( i6 }( i& c# m" M  Ping statistics for 202.103.96.68:
( ]. J& f1 g1 }9 c+ Q2 j7 t  
3 v) t( @6 J, M  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: + o( T' F8 G5 r# x; `
   5 B$ z0 J: M0 z3 w2 ~: y
  Minimum = 40ms, Maximum = 51ms, Average = 46ms - T1 v" |6 U; c
   5 p( b9 ?) d" [: t, H& W$ K1 p$ @6 Z
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ; i3 z" I' O6 }* U
   * {! F  [( r  J% g0 i
  -l size Send buffer size.
; `" D0 y. M8 y9 ~. |   4 S" D# u! g  i6 ^* r
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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