返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 $ C5 T& ]: q& j/ D2 N6 j% q
   . X: B7 [) S, c: ?- S8 C* @
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
" z  J% {& O  y5 u( {) f, v  {* l   9 U$ P' D" C% m
  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
4 \3 L; ~6 G  u" k* `$ F, V  
  _$ s$ n$ r* v8 c( ~0 d0 l) d- S  Options:
6 P6 y! y  N$ `, z   3 S2 b9 @0 J# B3 }: V" a
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
# [5 j- Y/ x8 P. W; l+ z% i   . S; J' w# Z  \9 r, u8 K
  不停的ping地方主机,直到你按下Control-C。
$ y1 t% s. g7 |3 B( [4 e+ C! m& x+ _  
" K4 A& z  X; u. n% K3 l! r! W  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * B( u6 e: _  B1 B- ]1 a' t
   ! P( q6 U4 k) o
  -a Resolve addresses to hostnames. / {- j$ r3 q/ b
   : c1 Z3 E* c6 h, j' m
  解析计算机NetBios名。 . e. I8 ]3 k% |8 L
  
  [, _7 t/ N9 }7 Q  示例:C:\>ping -a 192.168.1.21
/ c! S* I4 S) m  
4 |8 |. l4 ]$ ?. U& n  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: . _: _- Q8 ]/ n. M8 u) l/ n
   & |" v- i4 a6 o! s0 |: e
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 n2 |- P& }6 o& ^
   # L! U$ A; O) q4 D7 X
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * W" t0 y/ u8 A, ?. G
   3 e- q1 g0 J( i# |
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* t8 N" _5 b3 z4 N% L; ]8 Y. L/ I4 F9 {2 K" z. c- J
  
. C! g7 i) F$ S/ j( C3 m  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' J# k' N2 f1 P! X) L5 w  
8 y/ j8 ?: B9 \8 ]3 {! R  Ping statistics for 192.168.1.21:
7 ~( }/ @3 H$ t2 v& _  
* k5 R& Z% F9 h  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
3 S! J) p7 y. R* d7 k   + O9 ]5 ~9 ^. n5 M
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
4 r9 ]6 j- H1 I% R/ D  
$ _9 |# B+ V  m9 L) c5 x- K4 @  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 : |/ n/ z$ l% h% d5 c5 Z
  
6 k5 H' d! m9 c; a* l$ J5 M  -n count Number of echo requests to send.
) j7 b1 Z  ], |- y  
( R- D) n( Z7 A, e  发送count指定的Echo数据包数。 ; V8 I- @  q1 A7 k
  
- Z, K- L9 \) x8 Q8 U( |* i  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
: z7 s* u5 ~! z* a8 o+ `7 I+ S   # C$ Q* x! L8 f
  C:\>ping -n 50 202.103.96.68
8 F/ b( `9 M3 B! d   4 X' y9 W7 e9 O7 I0 E, r) \" y, \
  Pinging 202.103.96.68 with 32 bytes of data:
7 O2 o  p0 `" D* P) M3 P   , H; G0 ]  \9 Z2 b# A. K
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" K* e. E( X6 y! \   1 b* w- W: u! t5 ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # T* w- K1 ?* S8 g
   ! s; V* j2 K) b* r6 v
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & V: w( [9 h& f; h
  
% D4 o0 n; t/ R: V- @  x6 K  Request timed out.
# C# `; U* S" b/ c  
1 ]$ b6 g& K( S4 v! Y  ………………
9 C& e, H9 M. b   . h: z$ c. L5 P5 O$ ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: m6 T- V' `6 a3 n$ u0 I   ( \( F8 C! o* Q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ M" e1 p2 H& X
  
/ [# J$ R4 ?4 O; l1 x$ f/ R, `  Ping statistics for 202.103.96.68:
, @% a. s) B$ W   + I$ O1 R: o0 N
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: - {; x: K" ~7 s. r* x) n7 @3 z( I6 F  Y
   ; f" M! Z/ P9 g- O% [  {) e$ R
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
* H5 q& o! i0 ~* |8 p5 o  
$ \) N  N! P& J  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 0 j; a. C9 v  O# a# p: k
  
3 B) h5 R2 E. d- K  -l size Send buffer size. : _: ^/ i5 H7 t) E9 {- s
   $ C& W% l" k2 l% i4 s& ~; H8 O  A
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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