返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
# r( j! c4 A  R7 J  
  v- O5 R2 D2 ~8 k  @# J# J  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
! u3 {, v- L, Q4 E' I8 o5 j0 M  
& ^4 \! e7 X8 H0 g0 H4 H  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 / S. S; v: }& p+ z+ J; R4 _, O# Q
   ( s( M; |( }! L8 l5 d1 u
  Options: 6 M) p% j/ ?0 T8 B
  
5 }5 O; a" h/ D; ?3 ~  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
' C! f5 y  j$ Y; }' }& _  
2 H' I% c" A* ], \  不停的ping地方主机,直到你按下Control-C。
) n7 }0 p8 v1 J   8 N5 y) l; Z& @
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
8 w0 ]3 s+ q' u& H- B7 [3 u% S   % B/ D6 }( z& G( F8 v; u
  -a Resolve addresses to hostnames. ! B# k* X  j' k/ o" U* w3 P
  
) f7 n/ F9 m5 e# _  解析计算机NetBios名。
4 `9 Y+ O) R. [0 P  
9 |! d$ m8 r$ A' S  示例:C:\>ping -a 192.168.1.21 . I3 `0 L8 J* |
   ( _! c7 \7 ^& {; k3 D' q, \7 \2 p4 _4 A
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
: h7 d/ o8 l1 {   9 D# n' a8 `' Y4 I" Z4 g
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) ^5 I2 A! G2 S' |$ ~  
; [2 ?1 g& ~; \' w' u. m  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * {2 w& x* ]$ y
  
/ G+ a  j; u  k8 o. ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 o# y# A- l  Q) r7 U/ M
7 E8 S  D. m& E2 u8 A2 y
     i  ]' D3 T; J0 d' D
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) m& H0 [, p) @& d4 t! D. e7 [" x* A$ c  
  q/ Y6 G! z# C3 p  Ping statistics for 192.168.1.21:
& N+ z6 K" h" m+ N4 P1 e   . y) K7 J5 m* d2 K0 M1 b4 f6 T
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 4 T( [! d, Q$ k$ Q# S, A: S
   * U: \5 F/ ]2 ~! s
  Minimum = 0ms, Maximum = 0ms, Average = 0ms - t: E- L1 p. U1 d" C
   4 I, w1 M& h  S9 e5 f7 q# }
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
- |$ }3 e  X; t5 Z8 q! x5 [! l& W  
! y% x$ c0 v" O. Y" y  -n count Number of echo requests to send. & p1 a/ l- \: I( T% O
     l- C' V  `/ k
  发送count指定的Echo数据包数。
) l( ]* `2 O' d0 m) L   & U0 K4 a, o3 P$ ~( Y/ h) ~
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
6 v! z% L* X& J0 E  
, m" {& b1 ^& A5 S/ L# g  C:\>ping -n 50 202.103.96.68 ' y- ~1 Q: {  k% A8 V
  
6 E1 Q) A9 g3 [: b5 H  u% ?9 R2 q  Pinging 202.103.96.68 with 32 bytes of data:
7 r2 O0 w+ x4 }( _/ a9 _5 o  
" S- c! T2 e1 k! ^# w+ F/ b1 R  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 P& ?4 J$ J9 e
   6 S" H8 U2 p+ P( p, Q; X' b' s
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ K6 i# M7 @9 K, k, V, k   * q% l+ M" q, Q1 _! S
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % ?1 U) m% B2 ?( ?( o0 ~5 y1 e- x
  
5 q" B* v9 H& ^+ Z  Request timed out. * E! U+ C/ |- j1 r
  
% {- \7 e0 K5 V; ^3 o# X  ………………
  y  z: M: t  V+ ]2 S8 G   " @8 c' U5 K5 O% [. h) V5 f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " E- p5 U) d1 ~3 h( S
  
* d5 K/ V+ V# x- @! q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * L' j+ h; A  G+ c# c  E
   7 W3 U( t4 Q; p% e: F. d
  Ping statistics for 202.103.96.68:
% G: q& e0 Q1 c+ m     L. P) r! B3 ?/ H1 `3 J  h
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
9 D( L2 q: c. C' l5 y2 d% A   $ e% Z0 p2 o: x
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 6 D+ k# U2 W% v! `; ^4 R+ t
   ( x1 V7 {9 F" r" D) A% H8 Y
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 0 q3 P! [6 j  D4 _9 E: J! Z. s
   2 ~) w4 H% b) C% O
  -l size Send buffer size. % c! y5 M: i3 e. {  y
   4 B3 k! I# o1 L3 `4 k: f
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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