返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
7 a6 [6 [: x* c' Q5 U- c   " j8 f* {6 @- c0 D* u/ T
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
/ h1 H6 b5 A: J0 D( @: y3 ?  r  
# u' D4 a3 `; x, m  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  D/ L) l" G* u   * H9 `% A' c% \5 O7 w% X7 {
  Options: 7 E) ^0 L* u' o( C- A  Z$ M
   / y$ u2 Y/ J# @6 b# k9 X( g) c6 F
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
4 g5 Z" f# O) Y  H7 I; |7 e0 }' r/ x   2 D7 f: c1 t* a
  不停的ping地方主机,直到你按下Control-C。 2 _$ w7 y) u, z/ @, N
  
. H0 p) i" e% }# D. q  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
0 K/ d- \; }5 b8 h+ E6 C/ w9 a/ R  
4 P: g5 q( L/ m" _3 }! p9 I( I) }  -a Resolve addresses to hostnames. . Y( V3 ^1 h4 s6 w9 N
  
: ?  n& u; T; B$ W+ {# j  解析计算机NetBios名。 9 f7 P4 d# ~2 [5 S8 N& e3 t
   9 f  K! i3 g& ^+ I. m* Q+ w8 b
  示例:C:\>ping -a 192.168.1.21
$ T3 l) m6 V8 \: w/ T  W4 {   / Y' M8 h6 V# K% d
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! `5 o! {+ y; I4 g/ N  
1 X: g9 @  r$ u8 H" n  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  I/ _6 D, [8 @! i  
1 U9 ~( N8 ^% q- F. S  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & V5 B1 @! B. M
  
7 x6 n+ O: i1 a  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; [# I" \# g5 z

2 x6 ]' f( o- ]  }1 i   : c: v/ V7 q6 [. Z8 l
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ F) Y. E' N: N3 S3 E  
! X$ L! w* D4 `9 p- M9 b( c& v  Ping statistics for 192.168.1.21:
2 B$ I' D' T& ?& a7 M/ G   ( G  A9 `# t0 ~* R3 \
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
, |% Z- W8 {( T. Q   , W3 G$ \. G. {1 g3 w" Q6 T) X: s# a
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
" ~: d9 O2 O" W! E4 w5 N- x/ H% s9 F/ r   ) O# H( i7 R: U
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 $ D) T6 P& G6 q
   6 o( R& D; s" Y; s0 l
  -n count Number of echo requests to send. 7 z# N' w& ~5 s8 Z
   0 S+ w5 z$ K; Z4 i% g4 ]
  发送count指定的Echo数据包数。 ; c' Y$ o8 \' p, ^$ g0 k9 T$ u5 R
   7 ?- r& F/ P& \
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
7 `7 w  v& g7 I. x0 {# i     V5 q4 r1 O; P0 O. F" b5 ]8 m
  C:\>ping -n 50 202.103.96.68 - Q! R! Z- f5 ]
   " C& I* A. e6 ~, G7 z; s7 q
  Pinging 202.103.96.68 with 32 bytes of data:   e5 ]/ q3 p! U+ b2 A! [/ N
   - N7 l+ c6 f! G" J
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 c' N7 b  s$ T# V/ x$ @. B   + T( P+ N2 |0 H3 D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& p" b3 S+ j, \! r# g- [. l   2 f$ ^' ], |) V6 M& M' p; G
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 ?3 e! o1 i- H$ i: j, t6 r( W
   $ K* Y9 f8 x6 D( |. ?2 j
  Request timed out.
/ D; g( M/ ?. U6 v( T4 H) k  
5 Y0 t2 p( }$ ^' ]  ………………
" E3 q, w- i6 V4 ?/ y  q& J  
$ O' `9 @3 u& T, X9 }7 _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; R' W6 L4 H4 c7 W9 U  
; {5 k. W' z. L4 m" u. `' }$ ?2 k+ R, b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % c- s6 r. G6 F9 L- d
   , U  X; B  `* j( C: g5 d
  Ping statistics for 202.103.96.68:
' ]  ~/ [4 |# [9 F" _/ v  
6 e! Q  K0 a1 w! U" w1 D$ u  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; p$ j* A" X+ l! J" _
   # h0 O9 Q) r6 p" f& `! n2 x
  Minimum = 40ms, Maximum = 51ms, Average = 46ms $ v! g9 V( ~$ `: U
  
2 l: x1 ~* B2 d' I/ M  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
& x& H3 r- C+ `1 o   0 X5 y* g, t, r, B
  -l size Send buffer size.
. j. D9 ?4 n! ~$ c; O/ I: S; r% ~  j  
8 @8 b! D* i. C) }  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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