返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 4 e) N3 C- S+ T% q
   ( j- v/ e+ \9 w4 X7 u
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
) d  H6 x; L" `2 ^  
0 T) j% @1 K5 W! h9 g# y  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 * `1 q9 u1 ~* ]( K
   . E' M0 f- R" p1 e- w! C6 ~# j" n
  Options: / m+ a+ {% {3 }9 V
  
: w2 M5 ?3 }! z  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 9 O' R/ }) L" C- O9 K
  
  X7 f- h) b" i( \3 ?0 |! I6 ~' n) I  不停的ping地方主机,直到你按下Control-C。 7 {. `# f5 D! h
  
  D: t' N; v* M% C* X  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 & f$ @; a/ H2 l( c( e
  
" G5 ?5 O2 F' B' G( T  -a Resolve addresses to hostnames. ; h/ G6 n6 D1 t, b0 k
   * j$ D1 r. O# R; y% [4 i- m) \7 Q
  解析计算机NetBios名。
" B3 |9 z& l% }! K+ p3 P* b  
' r2 E1 k2 J: w# n1 f0 P3 w) p  示例:C:\>ping -a 192.168.1.21 2 P1 `$ c7 J- j) ~# W5 O  E
  
) Y9 O1 l0 O* }/ K" Y. Z) z  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
2 `. e( |) F, \# u5 Y7 Q  
8 |/ W, ?2 X" }& t4 x  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! w3 l2 f! _; a8 |0 K" s   / P7 w! j+ z3 X- f
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : Q2 O; ]* A8 d2 Y
   . {$ g. I3 g! p9 R
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 J% Z" r( }* i( ]% a, s8 \
0 V0 k, {+ {! @+ V  
5 w+ J  l, |. n3 F8 G  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & T7 B1 B1 y+ n$ e
   8 i/ ]/ N6 B: y9 u% `
  Ping statistics for 192.168.1.21:
% r5 L7 }4 \, B. `: j  i4 V   + P. O8 N6 i  d7 n( d
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
' M: g# G$ k" d- Y  
% Q8 h: |# ^3 R5 b1 `( k  Minimum = 0ms, Maximum = 0ms, Average = 0ms
/ q+ S# F1 g2 I; n! s  
$ ~: l% S$ S/ |  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
+ B1 f1 H4 S$ J. x+ F   & v+ N# {0 k, l- P
  -n count Number of echo requests to send. 1 D5 ^$ Z7 j+ _0 T
   * }( `% L6 D1 h* f' \
  发送count指定的Echo数据包数。 2 ^- ]0 Z/ O# q0 O. R& f
  
* \- O9 A+ m1 Z( Y' N* t0 h  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 2 W3 R. _. Y& t4 R
  
; ?8 Q6 ]% v' w  Z1 M  C:\>ping -n 50 202.103.96.68   b/ F" W1 \' N
   ' l8 x8 d* x% t% U
  Pinging 202.103.96.68 with 32 bytes of data:
' m9 L7 s& W( b0 E1 g' R% G   $ v5 F# i3 Z; p- K4 c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) t2 l9 t* M. Y$ v/ I, C' `  
7 L& [/ T/ Y/ s4 {8 f6 b  ^; b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & P' W# v% y4 S& v2 ]! ?. g
  
5 ~% @+ E# E! _) J6 g5 F3 m5 {9 S  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 Y: |9 U0 [3 b) O  
, b* S" i' B5 X! b) ~4 D  I  Request timed out. ( @7 b( B2 I+ u$ v' i' T' r
  
5 d8 |  {1 O$ l- d5 j0 ?: f  ………………
' k6 q+ u3 |  \+ |) r) L  ?. @   , @: N  T$ j4 B4 @2 H' n
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % e; u/ g, w" `; V4 [  F, K
   ( u. F9 T+ [* L2 h# {( n
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / ^8 T: I9 X1 M( E2 x/ u1 O* d
  
6 l) L, r# E# h' R  Ping statistics for 202.103.96.68: 4 j; F/ M1 F8 W& x
  
1 D7 F& ?: H, M. Q# h  o0 o  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
; G+ v4 Y" p- `  
+ k' C% R: G4 j( f/ P; a  Minimum = 40ms, Maximum = 51ms, Average = 46ms . p* p: V' @9 s$ P( {: x8 h
  
% b7 m$ l1 R$ c: ~  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
$ p- }) ~5 A  r) ^  
( [/ a9 k# J3 K8 M) u& k; d, v  -l size Send buffer size.
; u' S5 j$ Y0 ^; T( h# V  
5 m9 \) ]) F/ w. T6 v  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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