返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
8 g, [$ `- I/ O+ W1 |   : U; p3 `# u  }6 h' ^- n
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ) W, P5 h1 R0 y) ~# b0 i
  
7 B! h% K# I- I) b/ F+ |  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 ) A7 m8 t6 F5 L" Z
   - ]4 q& J$ ]2 n- m, V0 x
  Options: ' x( \5 S0 V# ?$ Z4 I
   . F  f5 B$ K5 l4 B
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
  Q  s+ _- t2 c" `  x6 s  
7 I0 X; J4 T3 L6 x) \* z0 h" q  不停的ping地方主机,直到你按下Control-C。
6 M/ D% k$ m2 |: R; e   . t6 I9 C) G5 u: C) A, S& ?: i
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 2 ?5 V) q% r/ ]8 y3 v
   " F# H; w: B( G5 D. q1 f
  -a Resolve addresses to hostnames. - g. Y, O' e* f0 S. z* M8 E
  
9 J, r9 p* d! V5 J* @  解析计算机NetBios名。
. n: T4 k  N( X; R  
1 ~8 g" y( n, ]  示例:C:\>ping -a 192.168.1.21
3 K" e4 O3 o% x3 b# r+ C& r9 h$ H   5 T, e% }  s% F: C
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
3 U7 K& A/ U" C; L" ]  
1 {5 S/ c) w0 i- B. A  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* M/ j+ y9 B: y9 g3 r7 i: j" B5 R  
! {3 J1 m4 F2 q( j5 v! ]$ ^5 x  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. Y/ m7 N. `! k4 S+ a& {* ?  
. a' Z1 h: t, V* S7 o; g  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% M  X, H' Q$ T0 a9 V# p5 K- d3 J
   % z* j: i2 [1 X) O" ~$ d% \$ b
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 j$ Y0 z% o7 D* q+ t% A     K/ l; v% v, {4 t! `
  Ping statistics for 192.168.1.21: * w6 _$ f! }- p
   - D- ^3 _" R/ \, w
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
# l9 n4 }: m1 c4 X; L; G, [, \   ' e5 ~+ e* ?0 K+ P( z  J1 a
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 w9 t, Z9 N/ s( ?% q  
9 D& w7 m) F# O- p1 M5 V+ u  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" Z4 `8 s6 X& c1 ?  
+ d$ \; c, ^0 A1 [1 K5 c  J; ~  -n count Number of echo requests to send.
$ l" \5 B+ ~8 e# z6 o' _0 v" d( T  
) F/ C8 ?7 r" }+ r. S  发送count指定的Echo数据包数。
. ^; k& P* [+ E# }" D2 d3 g  
* y$ j+ Z! t/ d) p2 F  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 4 g: r1 G2 Q0 Y: L' K' i
  
5 |" e: ?, G' f$ q  C:\>ping -n 50 202.103.96.68
0 F0 F5 `% u, j# Y2 z# G  
6 n. y( a5 R# n  Pinging 202.103.96.68 with 32 bytes of data:
; e' x/ ~5 @2 S$ \) }   ! R5 M9 F/ {1 F% L% x4 A
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. j4 W5 ~( R) L2 A# y# X& w- ]   " U& R/ X3 T! v( c8 l5 p# Q" n
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' C* W) H( ]# ^& `% n
   0 {0 S) _+ z3 g( o: E# X1 H" N" X! f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ C. }7 @  T/ ~  Y- Q  n6 e$ y   9 G- `8 ~) P7 `8 q( w  S5 d1 ~/ p
  Request timed out. 4 [# d8 v7 ]; }" B
  
1 {1 M. ^" m- w  ……………… 6 y  s7 r& _7 V9 }3 Z, ^; E& ]
   8 c# G9 ^2 C# d4 A  D# I9 k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: Q# d& b7 k9 d   # z$ a% {; k2 g2 o5 n5 p
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # B/ T- u( o  ~
   ! V3 D0 F, Q; M) I) H7 `% m
  Ping statistics for 202.103.96.68: & N6 B: v( X, R2 E* h
  
6 ?1 k! _5 X- J. C8 }' {  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
, e6 O5 R6 |& W' r$ Q: k* }: A" A   ! C  \( b' G6 K' O% i: P6 z
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 P. \- \% p4 g- ^4 N2 ]
  
! X5 Z2 p/ i9 ]3 H" {9 x( D4 ~3 H+ T  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 7 X) \% L3 N& u: [
   9 U9 I8 V4 P3 g# j- x% q( b
  -l size Send buffer size.
) T7 W5 |9 I) T3 o& o) i& a  
6 }, ]$ q, H2 w1 D7 c0 L7 P' A  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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