返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 5 p4 k7 I$ @  a
   9 y. W/ {" `9 `1 Q$ [3 n% g, Z: x; j
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: " F" P* a) ~, h) H
   2 P" F4 o; [; v5 U
  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 / C" z% v3 b7 X$ V; n* e; P
   0 c; z! t: t0 p. N2 G" e
  Options: 8 X8 T5 t2 O( e3 m7 r" I
  
2 v6 j9 T. j2 ?0 p& `' D  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. $ e$ d1 F, G$ l; H& h6 }; E
   7 ~& S# j) N, i. @$ p
  不停的ping地方主机,直到你按下Control-C。 - z" _) [$ a. r5 g
   1 R3 w' ?% ~1 W/ z
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 0 s3 q) O5 h/ F
   1 A9 [3 W4 n7 ~8 g, F7 X
  -a Resolve addresses to hostnames. ( o0 O; p, ]! X& ~$ H
  
6 j* O' E8 j! r' Q6 j4 F, z  G  解析计算机NetBios名。
2 _% S! |) L( W9 m  
; p& o" B$ `0 C  示例:C:\>ping -a 192.168.1.21 ; f$ X  v$ Y, ~0 E  _) [4 Q' h
   4 T* {& b- e7 w8 s( h& `
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
6 q) L- o4 v( P$ r) K% n/ o- ~   4 @+ E+ v3 v0 ~3 @
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " R, Q' k+ z3 O) J* T0 c; P3 T
   : I5 ^" P9 e7 C  G, G' H' y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 {# S2 N5 t. ]( m4 W7 ]     z3 m/ O: B  ]1 G; M
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 @* w* U3 r( V! d. M* `$ {

& L0 g* z8 R5 a5 s$ A* ]   : e7 m8 w0 y8 O2 U% d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# X8 t. F3 D4 h' K: ?  
$ m. Y8 R7 C; R/ J/ }) K+ z& H  Ping statistics for 192.168.1.21: : H$ V# n" j" `5 r9 V/ O
  
: A2 Q& u8 a, m- ^  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: " Q0 k/ g$ t# s1 t# ~0 s  B
   0 G( ]6 S) r# l" Z
  Minimum = 0ms, Maximum = 0ms, Average = 0ms " o) Q! y$ a: @' @2 ]
  
* V9 f! t% N  w; `" A/ G3 b  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
' T3 `$ n& e3 \* p- I& v! h+ r( E   " |0 p7 j, M; v; u2 J/ `( ]: M
  -n count Number of echo requests to send.
' q/ M# \7 w3 ?# ]% H3 A  
; `2 ?- }& Z" B6 _  发送count指定的Echo数据包数。 $ c$ [7 M' O& l& Y( w9 t2 C
   ' {3 V5 F: z9 \: C1 l9 A9 j
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
% W8 a$ r- g$ c/ Z  
+ N% y. ^2 D" P  C:\>ping -n 50 202.103.96.68 ) W0 [4 s* J* A1 P$ n  E- e. F
  
9 }# B7 }* j( ]4 L  Pinging 202.103.96.68 with 32 bytes of data: 7 N. A% k0 W0 ^2 h2 i
  
# E7 X4 P. v9 Q2 p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& s: B8 D# I4 G+ I  
2 R; {- c3 C/ f) l( p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   Y5 x; B" H# |' x
  
) l" t: K1 ?; u$ J7 B+ Y6 Q' A2 y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 r- w) ?! D6 O   . Q4 t% r3 C. G3 R1 _4 x/ A
  Request timed out. & o; ?( N: y) y$ J2 a
   ' j$ u. O  u% s( x  S6 L
  ………………
" w& j5 X1 P' v  
) @5 p6 I4 ]" w$ q+ {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , c# l# x% p3 p8 @3 f6 l! h
  
" U7 g) B  }: |& m8 ]0 z+ }  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) t  v1 u5 m( Y! n9 b' N
  
3 k4 [4 |% w7 I; O+ ?  Ping statistics for 202.103.96.68:
3 _  f) `. ~5 v" e  
1 {: \- {+ t$ k# {8 O1 z; |' c7 `  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
5 s& F* U- u; d  q' J, q# u- L: o  
6 s. s* t3 b  A. `  Minimum = 40ms, Maximum = 51ms, Average = 46ms
( K) N' Q/ }( I% ~# x0 K- f  
, a# i5 d6 x0 {4 U' C) p  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 D9 N6 q+ a$ ^
  
' I) ]8 n1 ?2 _+ r2 S& c  -l size Send buffer size.
/ u  v" i" `8 `' y0 a  
8 b) J2 y* \7 @: ]" g  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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