返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
6 k/ ^( y* @. {" t  w   6 O3 n! Y9 q. {/ S+ M/ W$ @+ q
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
9 O0 |2 x( T4 ?0 }  U   " v: D2 f( x' j- x/ T
  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
  E  V# f% z" F: d$ `1 q   2 b' o% H2 n" A& x. k$ [
  Options: ( y! S7 D, H  L1 `) _7 q, Q% {* r* a
  
" {8 Z. a  z  G- x: b- f* p7 U  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
' \& C8 \! D: [* n0 q   % n; X; [7 J! y& W- h
  不停的ping地方主机,直到你按下Control-C。
; @) e( ^. ~. ]4 K6 V   3 N" t5 S& {6 }$ i8 T/ S8 G; T& ~
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 3 `; f+ g% [$ ?% Y. [3 s: E9 Y
  
1 P$ K5 z# I( `, b8 o  -a Resolve addresses to hostnames. # I6 h) y6 r$ J$ }0 J) ]: S- I+ N
  
: M+ h; j% q) l* I  Z, Q! g* s  解析计算机NetBios名。
% q9 B0 H" P8 _- |   : |4 O' K: K) [$ X! u( ^$ h
  示例:C:\>ping -a 192.168.1.21
& s! _3 J- W9 ~  F8 g% Q6 A  
, U1 g8 D; j) d: U3 G9 e  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
+ i( G) O8 f1 d  
; Y' O8 Z; J" a# Q/ c: N* A! l  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - }4 M! m4 x) D' p3 h4 `# u9 S
   ) h- o7 N4 i; t
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   F) A( s. d; v7 e1 s8 _0 S+ `
   3 h3 g( h, s8 C9 w, |' o7 d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ d! A) B; Q6 t3 y0 u1 D+ d
& e0 R1 P, }5 G5 ?   0 Q( Q" w4 [. N2 q# s: F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 P, V$ R: H+ K$ I3 Q& U+ z9 [9 i0 A
  
1 r* p( e$ d9 F0 J+ C; f8 g5 `  Ping statistics for 192.168.1.21:
# v% d3 y; N; h2 T7 y   5 S# o; f9 b3 O" i9 f: W7 O
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
- g! R3 S, r; |% G   6 S( P- K* |' L/ `6 M
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
- e% |# ?  V! K2 J$ R   . N" W5 d( d8 o) [
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
) ~& C% a+ y- q  
% E" `; V# w. W/ d  -n count Number of echo requests to send.
! ?* ^8 v4 u, y+ `! G  
+ B! ?* U0 i" R6 G  发送count指定的Echo数据包数。
6 W9 O( F$ ~8 \1 d0 [   + v1 A4 J  n1 i, W) z0 `
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
0 A$ B! \4 A, Z' i7 o   ) _0 x8 x1 W* E# s- s8 {
  C:\>ping -n 50 202.103.96.68 8 L2 |/ {# G$ @
   2 C5 A  D9 k4 B1 H7 B# h
  Pinging 202.103.96.68 with 32 bytes of data:
6 B$ L  K! r0 R+ Y) P   - f" Z+ G# |* c' ~7 N8 L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% r" I6 G; [  O  D, G& N3 q1 U  
' {4 u& Q: ^) e6 \6 X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* g: v! I' H$ b: |  
7 c: ^6 F3 f3 Z0 C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 F" a& r& T- Z/ X0 I, T$ S/ o: f
  
6 E8 g0 v& b( U% J+ }  Request timed out.
/ L% A4 g* H1 i   ( ]. k. ]! x5 r( v: @
  ………………
; b$ a- \( P7 @6 \! u  
6 P1 h/ Q. W# W. M$ N& |  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 v4 o  |' P" ?4 ]- x
   ) r' V/ \9 g; G9 r4 m3 }! g# }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" J9 Q( g( V" Z9 Z  s/ R  
' _) Q2 h7 d& L  Ping statistics for 202.103.96.68:
; |1 y9 G  O, r) M6 [; x0 H   9 J" R% R0 ^! S6 n; X
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:   V1 G$ ~. C5 G( u
   $ w  L  d8 @* F1 F: T  Y8 J
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
2 \8 F' k. z$ o5 U. A9 {- v   - u  ^$ P, e+ w8 K, I
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 6 O0 v: v: E& p, v6 J2 f+ E6 @4 m4 R
  
" \/ ]0 B6 Y5 i" b6 S: l  -l size Send buffer size. ; G  J5 B9 {  j/ a7 g
   ) }8 w; Z% u6 U: Q7 q" `% |- k
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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