返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
7 g. X7 R5 p2 l# m  
+ ?9 W) \+ R% t; p  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 5 {" p, Z. H* `9 ]4 Q: n6 q# N
   8 y! C+ s5 N; ]5 T2 @$ Q
  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 # `, d' I8 o* F9 X- n+ k: f- F
  
$ h; [' f) W+ }& m4 K! A; ~( D! y  Options: " c0 A/ D  u+ C0 H1 {2 I7 x& Y; h
   / r3 q  q; ?0 y2 j$ ?# ?
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - v+ j: }9 ]$ n, a3 p
   ' k! g' J: R0 J5 j+ F8 j& ~
  不停的ping地方主机,直到你按下Control-C。
" Z' V1 K" V8 g- v   " V! i$ D% d3 I8 B
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 4 ]! N. w# J2 e9 L
   $ V' y2 H% t) z$ F
  -a Resolve addresses to hostnames. 8 [. H# V" `) i% ?6 j& u! K
  
+ u: U* y# N; L3 }6 O! f  解析计算机NetBios名。
+ S9 s+ \" z: }5 K$ L: j4 I   / E3 z- A/ V% f7 ~3 {( I3 _
  示例:C:\>ping -a 192.168.1.21
6 g7 ], x4 o9 [& z# t4 S+ p     \, P3 H4 G8 m# I
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
: E2 _* H2 m+ `* C4 W; M- H" y  
6 M' z/ F2 k; O" C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& e4 l6 @5 Q; B0 K   9 w; Z6 v/ t* ~5 E" s- K4 j
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& L& j0 {. f6 @9 Z+ l9 \5 ?+ {  
, s7 W, r. Q, `! e, b  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" j: h; j; Z  g2 Z* k( b7 p9 h! }5 ]3 ^' i
   0 w0 Z, t. `/ `% R; G  d4 k3 t2 r
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( p& u/ _( V4 z6 B  
3 Z/ F' M- v  s% e: z% C  A$ N  Ping statistics for 192.168.1.21:
% o; _7 w) X& o8 H# O   - [0 z) @' j5 `( N& _
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
- Q: _/ e% {4 F5 |) S0 n" R0 L  
. R/ r* E: i& A% n' W: Q  Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 K; E$ P1 H! Y1 P3 ^" i+ R
  
. Y1 m9 |+ U& E7 u# Q" E- ]' G  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ( B; ]6 ^" [* M; V) g
   6 F6 Q+ a; V6 H! Y* t9 t
  -n count Number of echo requests to send. 1 n9 n! C- R$ j+ ~
   - O9 O; t7 W% b
  发送count指定的Echo数据包数。
/ O* Y5 F/ C- f  w   6 {- p& c/ I$ ]% l+ `' n8 K# Y- s; \
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
) o. V& l" F" e  \+ {7 `   " O1 b, v3 k  Z6 f  ~
  C:\>ping -n 50 202.103.96.68
2 K* z' C) v) s   ! t: n, L$ b* \' v/ l: B/ F0 |" n
  Pinging 202.103.96.68 with 32 bytes of data: 7 I! Q; t! j- r
  
: C. W9 g% O- Y7 S2 {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! v/ _" j0 b" e! T1 g+ R, P$ x
   4 b* @  G8 ^' s% }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 o7 c$ o2 B/ n8 {  b3 q! H
     C4 H! ?) _& a( T9 _
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 s# E) d, h" v( A  X, _( r( e7 [, d* P   ; M. Q7 [* q! C5 ?' s
  Request timed out. ! g( N6 C( M# X- B& V* D
   , z4 ^& L9 Q/ v# S/ c
  ……………… # a/ v- g1 O1 f. H$ O
   / W  S6 `/ ^* Z0 n# d" c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! d; h$ {6 J- i# s) x+ H  
$ k. W* P* c8 a" c* Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  B# O8 L- x- T! w1 Y   . x. O+ p0 l; `; ]2 w
  Ping statistics for 202.103.96.68:
2 ]- U5 ?/ O2 e: p+ p8 d/ G   7 ^4 b. k, H+ I' y) d/ S7 i/ D& ]" e
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
% z& @8 A) C* e: ?+ z  
! C0 a2 X) v6 f  Minimum = 40ms, Maximum = 51ms, Average = 46ms
0 k  K" `$ z, u/ c/ W. |5 J/ ~, H   ! f' W4 x1 F: s& Z
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
  O  N6 A1 `' {& E( e' u$ r4 c2 z  
8 V9 y. [* ]- Y# G/ K  -l size Send buffer size.
. ]+ q3 L7 ]# P+ d; s4 A* K  
9 z$ u6 w. e3 U& D$ d  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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