获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 , Y& f8 w% f5 k3 C1 J. w, ~2 J
  
7 [: B- ^8 B0 A# y8 R  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 7 W3 G1 U- B( e( A
   / j4 |/ o; \" q! 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
- C2 j' {7 n& m# f3 J" Q, {7 F+ G  
& d# Q$ n$ o5 }% A6 V% k  Options:
; @; M8 C8 v, Z# |1 n  
( i9 v- Y& r0 D2 t. P, y) d. J; \  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
. V( F% e% Z& Z6 X9 G+ U% \* b2 `6 z) t  
* Y' B- ~; R" m0 Y- l0 ?* Y  不停的ping地方主机,直到你按下Control-C。 5 U) L" o% D2 {: [
  
$ w2 }, s3 L# M- L- l0 B3 e  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
. E4 R3 [, N4 D$ ?  
8 {# X& r# i$ U7 f: Z& \1 c) y  -a Resolve addresses to hostnames. , T  j; c- U3 O0 {) m* b0 A
  
8 N" |) V8 e! y& h  解析计算机NetBios名。 0 b; z1 D) @) a0 o  {5 z
  
& O: g: d5 K; h6 f$ F2 q% P  示例:C:\>ping -a 192.168.1.21
0 R0 l' I. I5 O3 J. b  
3 g2 S; E' S: k8 M8 e  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ) r" Z4 B; y! O0 F* K% e! x8 {0 V
  
- B! P3 X9 B" E6 _, F3 g' |6 `3 N  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; n; K+ s# f4 ^" f4 [$ j( G
   9 e6 _5 q: q8 b2 n1 K
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 f6 K: R- o+ K% ?  
6 i* K8 {$ C9 [4 n( _. d  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: S/ P8 H, M" \3 N: p$ Y* z
2 N7 O7 g2 f4 X0 d2 M. K" _* H  
! f: y) G" ]& q8 O- ^$ D2 \' q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 _; C$ p3 x( O2 R+ N9 K
  
5 B' d+ l' m9 l/ ?  Ping statistics for 192.168.1.21: ) O% ~6 T( }* v: {& k* `( N8 p
  
+ i: }+ }$ E. q9 ?  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
1 {0 z& z8 c2 R* X   " P& [% q0 x* [/ G# A
  Minimum = 0ms, Maximum = 0ms, Average = 0ms * g- _7 w0 U6 s& M2 |% S; F5 w+ E# r
  
$ A9 |2 ^* d' I3 m) {  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 6 }; N- _( h/ m& C+ H2 N' D- [1 Y
   $ G0 w% A2 H; G1 `6 j
  -n count Number of echo requests to send. / [. n  y( ~! O
   ; y8 v; w! P3 w2 C! }, W' C. O- m
  发送count指定的Echo数据包数。 3 t6 c7 e3 t$ e( H5 U2 j  y
   0 R: C: l" Q( @4 Z: G) b
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
- X% I: m# ?( z8 k7 J+ j   % t5 G' ^, N$ z9 z7 [
  C:\>ping -n 50 202.103.96.68 # w  \0 }* L1 F& Y' u! ~& P
  
% B7 d( j6 h7 ]( g8 Q" a  Pinging 202.103.96.68 with 32 bytes of data: . o! b+ [/ N8 h% c
   ! T2 v/ B9 ~" V) ?1 C
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 z  Y0 a+ T& }
  
& s8 |& k0 }4 _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' @) S# B+ z0 h7 J- r5 \4 `  
. m7 U9 Y. f0 i' |" E  r5 _6 q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) o1 ~! n8 ?" @2 j  
; t+ H2 C% m  D+ `& {3 z  Request timed out. , Y; G1 u: u& C( Z
  
2 b1 j5 a7 n; K6 B( B/ T  ………………   }( ^. p- ~6 ^; c; ^% M$ P
   * x" f) S+ j& D. Z8 }( U4 [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) {. F! G: r/ R* X' L' K8 W   0 D1 C1 I3 \3 Q0 d# z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # ^% @$ _5 |6 p0 l' |$ }: t
   7 P* n( |0 ~3 Q" g% ~; m( I0 o$ i
  Ping statistics for 202.103.96.68:
5 Y3 W; ?. C% |6 m: m: r   , ?8 H' @1 e& r
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: : Y* y9 \9 [4 L$ a) F
  
0 ]1 P* {5 T" J1 U  Minimum = 40ms, Maximum = 51ms, Average = 46ms
% V7 |% S  l, K  P  
% r% b. j' T% `* g( r  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 2 q2 w0 x. v! ]) E7 S2 K
   0 q  V6 ?. D8 y5 S) q' B2 O, ~3 O
  -l size Send buffer size. $ f6 J  r3 s5 I" Z
   ) [' f" R% q5 a8 B0 i% j# z" B
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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