返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 3 d' v( z( L* c7 V$ F: |! k/ a- j( k
   7 H( x3 h" N' ?9 R, y. a* |
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: * Q6 r5 o# d8 u' R" ?* U8 u
  
  e+ }4 ^7 X( a4 X  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 ' j" N* y0 k+ |
   ! Z  `* Y& l% d# D/ K
  Options:
; `: c( S% @# F  
* _) [% v- ^6 o+ v& j. R) R  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
+ `5 F3 X# f0 J* Y. Q   6 Z# K  h9 r1 c6 \& P
  不停的ping地方主机,直到你按下Control-C。
, }& n1 h; [5 o$ C, f  |  
4 ^( l8 J# n% A3 `! w* \  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 5 f) l) F; G7 q7 ~- n. b2 v
  
4 X4 o3 k, @! G$ U# w: g  -a Resolve addresses to hostnames.
, q# }+ I  X: `% F  
, Z9 `0 ~6 X+ v/ |, A# i( Y  解析计算机NetBios名。
2 S, r# _( _8 t: t! g  
* Y5 f2 ?1 V$ ?7 {  示例:C:\>ping -a 192.168.1.21
) A3 I3 x8 @+ @/ I1 }: H  
7 @- R' M5 b$ ?5 x( q) j9 U0 \  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: - ]1 s0 x! @$ P% |/ C7 A: j
  
1 U- i/ k3 I2 e3 A) d( B  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 n1 u- w+ J" U4 W& o
  
  X7 n  G5 U% e. p/ U+ Z7 W  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : F! C5 }6 a) F5 R
   ; U% l  o( `0 p" `1 t1 C$ u. v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# s* \. @6 h1 s6 f, I8 E# \" \* i( J" x6 E$ ?3 p3 V3 B3 [+ q
  
/ M9 C# q/ D$ ^2 G% N6 L- g  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# X5 z0 J6 F0 ?   1 C# ?8 ^' }- S1 |% Y
  Ping statistics for 192.168.1.21: ! F7 y2 q4 b: B" [8 C
   4 l9 @: j% _( n) b  o$ |
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: - j$ R7 S! o- }' |' U5 G
   ; P; q5 p2 [+ P% q  N; U  @
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
, H  v$ h# \. S8 o; f  
4 m8 f/ Z3 ~3 s9 Z  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
  ^. j2 u3 s8 u6 \' q& w) ]9 U  
* v, j" J5 g0 \+ x: _  -n count Number of echo requests to send. " \8 ~) i0 b! d
  
4 w- I. r7 t1 f# n: y  发送count指定的Echo数据包数。 . i  z/ @& r4 Q2 B2 C9 j! t" r
   $ P5 R* B0 s! N7 u2 g
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; T0 Y. x$ H, v0 [
  
7 I( S. q3 b5 m& v+ h) k: M  C:\>ping -n 50 202.103.96.68
4 i5 v2 x/ e6 l4 p: ^" t! a  
7 U5 ~% {1 K; j. e1 M5 n  Pinging 202.103.96.68 with 32 bytes of data:
( w, Q( _! r: c" P( m* H   / |/ N/ R$ ~) v/ E# N
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 J5 O0 e$ `; r; y) s
  
! v& |% M1 g8 U1 I& p0 q  D# `  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 s8 Z$ v4 M" _/ r6 P/ M
  
- b, g% p; ?4 E- j& u# S  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 S& c- e2 q2 V2 v6 K* m
   * q1 C+ `# I' }5 f- [3 l
  Request timed out.
( Y" b0 K0 w0 b( a) ~; i  
8 B. z1 ^' r. u  ……………… 9 e2 G3 }  j$ T1 F! B+ J: C3 E( z2 V
  
; @8 D/ s0 {3 ?; ^. i' G4 A  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; B" S0 z- R/ L, q: v  H' o; V
  
; F: n5 I$ U% \! N( T, p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( X! u' w% L; O' A   & k3 W( ]2 A  O
  Ping statistics for 202.103.96.68: 2 t# i. X5 O+ n: @2 K* y. {. d0 M
  
. G! `' @0 ~/ O3 G/ d  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
5 R& u  J0 l2 f1 z. [# _( b! @. g2 d; c   ) A  ?9 k5 E! M0 S. G3 b, Q
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
; A( @! j  B; Q   % Z2 L0 e* s' b2 e$ ]
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 A: ?, a) Y1 |" |, _2 p" n; S" L
  
4 d; l% u# ^: ]2 a% y4 \# o  -l size Send buffer size.
) r. e0 W6 l$ f1 n/ h! v) t) b   % a' `/ J& u$ c5 g. [; Y
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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