返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 , J3 K$ Q5 c2 F( g* M0 Y1 J+ s
     M: A+ G% B5 E
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
; p$ Y1 A( m, p) r& w6 }  
: I4 U# X: C  t  n  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
9 ?0 U2 u; N" t   1 c9 n4 J& S7 O
  Options: 2 W/ `7 P1 a& z4 Y, R
   7 ?/ ]9 F2 G; s
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
4 W6 Y% ?, Q9 s   / x4 o; z8 L9 r# k, {' c7 @
  不停的ping地方主机,直到你按下Control-C。 ! ?* `( O4 P) n/ i. @! W/ |
  
, Y+ f" R/ |0 @, k$ u  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 0 N' J' ^& q  j# ^# e
     U1 a+ r  ?% A
  -a Resolve addresses to hostnames.
3 {$ z. A9 z$ \2 l& ^5 S  
6 w" W9 J# i# |5 d( y9 h5 f  解析计算机NetBios名。 6 f; |2 B5 G/ X4 P
   ( n3 t7 q" K8 \. N. M
  示例:C:\>ping -a 192.168.1.21 + x3 j% v6 j+ H: G% E3 i
   ' a' L- a3 h: c7 z* O4 V) j
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- D+ Q+ V/ n4 j+ {# K   7 X+ c7 @; `3 b: ~; f9 w" P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 f9 ?' k: f) X4 V   7 ^- d, J. r- O' l- `7 Y/ d. @
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) S# J) c8 [  a' u! v2 q   ; [8 |; [, z5 ~1 y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & o) N5 z! C9 Z8 i; y; E

- i" l( l6 y0 |   ( J/ N& M2 }* y! F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 S1 F8 g, u8 e% T. `) {4 R   + U+ l7 Y, w5 H' N* E- }. t
  Ping statistics for 192.168.1.21: # u% [4 E1 H( \$ f& v. x
   " S7 y  s: S' {6 L6 b" [
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
- ^- F' z" p) Y' ~5 X. S  
1 [$ \& G4 `$ g8 w$ N  Minimum = 0ms, Maximum = 0ms, Average = 0ms " F+ L9 ?& p, X
  
3 K: Q2 b; |# D5 K  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
0 J! ~8 X3 e2 x0 ^   8 _# A2 C9 r* u( S
  -n count Number of echo requests to send.
: A$ b) S' P2 a( S  N$ i   0 o4 G, y* F# L( f( k9 ]7 n( L
  发送count指定的Echo数据包数。
: s$ o0 j: V7 F1 G" r   , ?. y' l; d5 x% O$ U* A2 V
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 7 E% Q) v% Y) F3 M% K2 |/ q/ d: m
  
/ E" ~% c& `  }/ X5 v  C:\>ping -n 50 202.103.96.68
0 S* G8 ]7 Z& U- ~1 \: B5 R  
9 N; C" s# l- W3 C2 f$ h  Pinging 202.103.96.68 with 32 bytes of data:
9 L  R: P  ?1 i8 h4 w* B  
. K8 r0 R" Y, W6 E- ?/ b& c  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; Z7 i  I; M3 |4 F. v% p   4 p- {1 Z3 ]/ ?9 V5 ?/ O  R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ ^. I. `4 a2 O7 }   / r/ m4 [. ]$ r1 `! I
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # q& I2 t5 h: ^) T; X
   ) b  }& C! X& r" r
  Request timed out. 5 \8 e$ n: K) b$ ?3 n
  
  E, A* @7 n# J2 B* o& x8 O  ………………
" \6 G3 r1 Q4 p0 F" q  
) }3 \# A! _; {$ B- \$ g3 T  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- J3 U+ H0 \4 A8 ~. M3 e, l3 g' |- t   $ z6 K! s- Z) _, v) e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 I* m+ ^: y2 n; `( L
  
$ j5 G2 t' M( I: \! M  Ping statistics for 202.103.96.68: ) Q1 }+ F. W2 h2 a+ Z% Y5 m
  
% a! ?) R8 d9 \% ]8 G  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
' R" F- N8 }) D6 ]" K   / |; d9 b' D  O* X
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
: k6 C  v6 k) F' @6 r     y3 G; O% m2 _( H( j" L2 @; e) `
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 / d% W  [. Q+ Q0 K1 P, K
   # h9 n0 O% y: o0 [/ z. A
  -l size Send buffer size.   v5 m! F$ r0 U6 d, I; F
  
2 N# n  \, S/ d. j; {8 j5 s  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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