返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 . q' a2 {1 Z  j/ y* t8 w
  
: O4 ^& ~1 \1 T  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
1 E7 t% T' U2 R9 g! A% F   $ Q& A" W; P* I0 M4 W1 l
  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 . A8 U) k+ ?; l% ~
   ; R- c. `# T9 J  `/ ~2 b% N
  Options:
6 ?. T9 W0 [/ n6 V1 l' v  
! `% F1 W! X$ H3 `5 {) X9 D2 {  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
4 l  u; Q7 }+ p( E4 h, Y   # L: e/ s0 w: F3 r! ~
  不停的ping地方主机,直到你按下Control-C。 : ?" A7 B$ ^- V3 t4 y
   - V$ Z* e5 d- j& x1 k
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 : z  r' A. N- y9 P8 c9 g
   ! w7 h6 m2 r/ z6 S: U! C2 R; U/ r
  -a Resolve addresses to hostnames. 9 ?4 j+ ^4 o8 l" B3 p( f, v
  
2 F2 I* k  z% g  解析计算机NetBios名。
3 k; D. w, _$ l& z   0 d- |. p' L1 i7 I& D
  示例:C:\>ping -a 192.168.1.21 : Q! V8 S1 a2 Q( b/ a, F! [; j$ I+ E
  
: c! m7 k" `$ B  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 z- y# d7 m' d* ?; d+ ]   ! q! \. `9 c9 O$ u0 L" c) f
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" I6 ~" L# x) j0 ^  
+ H1 c: Q6 o1 Q7 k* t* n; c0 ]  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 ~) L* i: r5 q  
$ {' q; E( O, a; S+ ~8 Y( h" O) W7 e( u  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 `, P, \+ Z; ~% [6 F+ G4 e
- a( R5 E. k* S" B2 `  
5 W* k1 q& _6 Z! O  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 h, H5 n+ `9 W% u  E9 t! Q, x1 N% _  
. u3 e) M: w" a+ O$ k* ]" @8 J  Ping statistics for 192.168.1.21: # e5 D& g* l5 J& b
  
8 v) {+ m  I! f  E: W/ s  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
: y3 N6 B* y1 s0 C+ b. f   0 I6 v+ W0 M( ]" e! f
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 q$ ?( A$ @5 q$ A- C) X5 u& y     H  l' m+ @" Y8 O1 c5 n' a
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" l/ l  P' c8 |* y   % z. {( P: Y) e  f/ h8 o
  -n count Number of echo requests to send. 6 X) [' I2 Y7 Y  o
  
! r  [6 i( ]3 A* L  发送count指定的Echo数据包数。 # @# v' {3 ]) o8 }
   ! g& R" @% Q1 U6 @
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
) ~% G9 \: U7 t# m! X   8 c7 G- O5 ^3 W. ^4 H, Z" k' j
  C:\>ping -n 50 202.103.96.68
, v  `" X$ O! V$ o5 t# u+ n  
9 q8 o0 g' x0 }  Pinging 202.103.96.68 with 32 bytes of data: 6 M9 C7 `1 R/ C# \  k
   # Y3 r% a/ R( l/ R  X: ^
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 u& T+ K! V7 _$ r5 b7 x/ P   . h- g/ j9 W* i1 n: \* I9 R+ r
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; z: X8 |* c& o9 }" H% C
  
/ S# K& n3 D7 m# u  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: K9 ]$ m- u" j   ) x$ n8 D3 p5 j9 Y; h+ j4 m
  Request timed out.
; W2 L9 o, f3 {! i2 x   2 T) ~$ B5 L8 u0 H+ r) V+ G
  ……………… . b( c% m( ?7 }, t: F: X
  
# W2 D! m+ N% E3 n! ^& p7 Y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 ~) }3 ~0 w; L; e2 \& X0 P* v0 {
  
7 P4 P8 t) T! f! R  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & D: n6 v% v1 v& ~
  
- r0 n3 S  V0 k! V$ f  Ping statistics for 202.103.96.68:
, m8 d( Q0 r+ R* e; @0 C  
' b, z+ J6 ?0 ]- N  a  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
4 z; J3 G- r  Z# F% ^  
# Q" M& W. ]! W  Minimum = 40ms, Maximum = 51ms, Average = 46ms / @  C' C, V) H4 x' W/ M
  
1 [+ P# _! f0 v! \- E) z  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 # T; U& j' w1 y8 S. q9 v* k# d
   ( m9 f* c3 D+ @0 l. D
  -l size Send buffer size.   Q+ k  n  @1 p
  
1 z! L7 f) z& R& g) f$ U  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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