返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 - T, _: o( l5 l$ n
   $ T- |. M  p4 w! y
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
6 [" a; g: O% e7 R: {: f6 X+ h3 a& R   3 i  c$ _& K8 I% V
  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 : [$ n+ ?3 }. [  d+ [, I9 A$ L3 Z
   3 e3 J  \: e5 N2 M0 v4 V
  Options: 6 p. @) M; x( C. ~, O1 I, W+ i* P6 n- e
  
; r- z/ r6 z+ C6 ]4 j  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. : C& S6 {# ~. }3 W
  
. G& a& B/ r! y6 |0 f* S  不停的ping地方主机,直到你按下Control-C。 4 B  D9 J6 ~' c
   % M: D2 d% V; J2 b  U
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ) T+ W6 d' |& T  ~' i
  
2 C4 z/ M7 v# t# Q5 e! k  L' E  -a Resolve addresses to hostnames. * I" B& A3 s6 z6 I3 F: b1 T
   3 k5 c8 b1 j4 f
  解析计算机NetBios名。 ) ]$ Y& F6 x) ?7 E8 N
  
' R7 Q1 g9 ^& p7 v  示例:C:\>ping -a 192.168.1.21
* S2 e' O# j% L2 ]* n  
4 K" s& O, R& @+ N  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: - u4 L$ w7 o5 Y7 {3 M! n
   % r: }; ^6 f5 h$ I) o# ]2 T. \
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # H6 _  Y3 v; p+ |' }* i/ w+ N1 z! H
   * X& s3 z1 p( M6 u$ Q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  M8 _+ f# i0 c3 n# H   / v3 T5 I9 J% {1 G  w, F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 M$ c: ]8 n$ T: _5 T! G. [
  [  l, J1 s5 J( e8 m* Y* v* w/ q0 l$ i
   3 i2 l% z& b9 k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 w. \! C8 g7 x/ s; C3 N   3 ~; o8 X  ?; ?1 l1 e8 C; t1 K
  Ping statistics for 192.168.1.21: 6 x. t: @# B% V6 Z2 ^& T0 ~* l
   + k0 ^9 I4 v1 G; F5 X, ~- p- |
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 4 P  `- h- i9 N7 x; Y( r
   . ]$ T0 ]4 Y3 |( H7 |
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 t& c3 L. R3 t   0 e& U3 ~, q* |; x
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 8 [; B& h7 B) d* d
  
- A) h9 k' E' t( z, ?  -n count Number of echo requests to send.   O; ~0 ^$ k' P  N
  
/ }5 I) V5 x7 C% b! X  t& V& X  发送count指定的Echo数据包数。
' N( s6 Q9 o" Z; K7 h     o4 }2 W  b2 ?/ I$ U
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ' y% X2 g1 ]9 O0 a) x
  
; @1 R% t7 J3 \6 g# X* q7 S7 i  C:\>ping -n 50 202.103.96.68
& [+ R2 g) A6 K! Z' J/ P  
4 w4 x0 D( M7 i9 E2 j1 N" Q  Pinging 202.103.96.68 with 32 bytes of data: " d; d- S# K$ {/ D- |* y3 L. m' ?
  
' T' b" V9 `" K( z% A- g1 r  @' s  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* [- O# [' r- o. N8 `2 i   . V& E, c& E* a2 B
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: ~; f" y7 V: z) O& b1 t   1 M; h& @' b/ @, R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, K5 Y9 B/ V# `, l$ A0 s" \   & U- j; {3 G) i, R
  Request timed out.
8 N0 C) D7 W3 Z) J  e3 u. ~+ o/ ~   4 s6 B0 f0 ?/ y) `3 J' E) k; O
  ……………… ; V: {+ B# Z0 u  M$ d2 j
  
3 i: O* e, o& k0 K) V, V0 p( ]  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - @& `' Z, v9 O8 g
   ! M6 K7 M; p9 a
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & v8 U3 x3 k4 D2 G) m; A2 S) ?, P' u
  
# H7 L/ @3 s6 F: l/ J/ i% J/ y  Ping statistics for 202.103.96.68: 9 J1 o6 f2 P9 B( S' ]
   # R; Z: F* M  T, Q7 q3 d9 ]
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
' A$ s$ G$ L2 `" p# E" l  
: {/ \" q+ U  v3 B; S; G+ T( _1 ]  Minimum = 40ms, Maximum = 51ms, Average = 46ms
3 K, z4 p9 {) d  v  
: k, R. u6 C$ b! X  j% ~' O4 L  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
0 v9 s0 {8 T( Z8 `4 ]' q! @   6 z3 l4 O9 w# F0 z3 {# g
  -l size Send buffer size. 6 v7 v8 y0 B3 ]/ A$ n
  
9 D1 b' C: p. D9 N5 v4 t- c1 Q  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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