返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
; z) Z0 `9 f$ [: k5 L) Q) r+ m( Q   4 l9 B0 y( \- s
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , Z4 b5 W+ k; }3 Y. A) f7 t
   . k8 W# ^1 V( u1 k
  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
' d9 ~: |9 o# c5 \   ) `, }6 R9 z1 {9 |# f
  Options: 2 W, t, a5 G) o0 t
  
# {8 S# a/ O! ~. _6 j; |) |" a1 L  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
  }2 w0 @; N* L) L- t9 p& R   " F2 I; b0 T8 i4 A; t! ?  X
  不停的ping地方主机,直到你按下Control-C。
5 N, b$ Z( Y  J1 t8 W  
, i: A9 {& v% V3 B, Q) ~  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 f3 x) I/ U) G. M1 i
   9 W+ m& T( T* H+ U( m
  -a Resolve addresses to hostnames. ; B& S; ^0 l) M; |0 `
  
" b0 v' W! S. B1 \0 A' w% d  解析计算机NetBios名。 4 S7 ]/ M; |! `4 H
  
+ J3 J6 n" Y, y% O0 y1 s2 {  J  示例:C:\>ping -a 192.168.1.21
4 ]0 P: z# J. c7 l2 u  S  
" R8 y. N9 J( A( u  U5 E  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
& [$ d4 l' a0 K   5 i0 x0 I4 C% A, y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# y& y* f. I' P) k( m  
% L$ ~: z; R/ y( g* m0 E  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 f1 |" i5 ]& u  v( m0 f  
( ]: ]4 K$ L" {( ?1 X' i2 H, [  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # A9 L3 t6 M* ^6 E
8 P/ l6 f/ x0 y; v$ W8 S0 u. F& ]" J* h
   3 n( L! [. K5 u4 x$ `
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ b0 c! B# S6 S   # x5 w/ T! `, Y
  Ping statistics for 192.168.1.21:
' O, t5 Z7 a, k! b/ n. M   4 Z9 `1 b- [5 ]7 ~4 R) o
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
- O$ T( y! n3 h  
; u) ^- ~* ~: z  Minimum = 0ms, Maximum = 0ms, Average = 0ms ) N  b$ O8 i5 m( J6 o7 f
   0 K3 c3 m3 l+ U  w. u3 ^5 c
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
' f# p: ^. p9 ?% z4 g/ i   $ y7 S7 h$ M# Q8 r) x
  -n count Number of echo requests to send.
' f/ i- E; z. ^7 ~9 i8 s: d9 M  
. J! ^7 Z0 u7 x/ @  发送count指定的Echo数据包数。 2 X2 D3 z6 G) D7 S3 S* y) A$ Q
  
0 [; y% s3 U/ ?9 A  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ) y+ I# M8 ?; p! ?
   # k- K( p; F2 [+ e2 R- _( |
  C:\>ping -n 50 202.103.96.68
# w8 x% @- O: H3 \  a2 F   4 ]+ U' v; C8 U8 r3 Q
  Pinging 202.103.96.68 with 32 bytes of data:
6 _; y: j2 s0 b   2 Q" j1 }9 d8 {8 w, t1 m8 E
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 a) V) i! t2 }0 A, Z3 u
   3 e$ |# x+ r6 x8 h# t0 i
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # N' h: j. x3 w# e7 D4 [3 i
  
: ^. ^1 R8 M' V& U8 A1 A  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 \* x9 E7 ^: f+ \  
7 h# A3 N7 X  l  Request timed out.
. ^0 K/ t" f; U! U* H  
' c+ _0 {7 z7 T* o0 d! ]  ……………… & P% [, W- S3 V+ q# h
  
$ A, _6 |) j7 z$ A: d  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ F" ^8 F) j" n7 G0 v! P' J  
1 v' t7 I6 x# u. C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 J9 g- h' y, Z" d( }! H" _9 D
  
0 _; |0 h& M. ~3 M, a" |: r% A  Ping statistics for 202.103.96.68: 1 Z: ^/ g1 B1 _# A& T
  
) |8 L$ G3 @) x3 a+ b3 K, s  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 3 u* W" d& u* g
  
5 y/ x6 ^% D6 V- o7 X5 H, d; r  Minimum = 40ms, Maximum = 51ms, Average = 46ms . z+ X0 ~5 F4 d( ~; j. f! Q) J5 e' \
  
/ a6 h1 k$ q3 B+ l  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 * B9 X0 V: |6 P' S/ P
     W3 a  j0 S+ i
  -l size Send buffer size. # ~% J5 f5 I+ f
   ( Z3 J' N3 x* W# G1 j3 E) c
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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