返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
/ B* Y4 [! `. L7 d2 ?3 l; Z3 f" a   ! ^0 c- ~! D& k9 S" a+ \2 Z
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
9 }/ N2 t5 O! K& k3 I6 V5 s# S5 i   & O' o) L8 I; 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
) z; c1 u. U- G& S8 `+ N  
% t1 d% M5 o) C9 V  Options: % \' ?/ w3 u4 {7 u- v
   * N0 j% T* x# k+ P* S  u# ?
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
  L+ w. _8 {2 H   7 O" Z( I. [7 R7 q5 |& }
  不停的ping地方主机,直到你按下Control-C。 6 o: \( f! \) U% U
   ' [: ~( E+ E/ F) I. Z" U
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
6 n8 E$ v4 x- S7 H4 ~  
0 B$ _! C6 n0 G. [( c2 a  -a Resolve addresses to hostnames.
/ Y4 z- d9 Q0 \$ e8 t  ]/ a& A6 L  
$ p0 |8 y. t0 s2 G2 T; n+ O' B  解析计算机NetBios名。
% K1 R  C$ m$ m   5 U, [; s8 ?$ n6 h, A4 O; B4 \
  示例:C:\>ping -a 192.168.1.21 5 V. ?5 ]2 P8 L9 [
  
5 `9 e4 P# n4 t9 Q# [3 k1 ]' z& p  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
" w, V2 N. Q4 n  
: n7 m# M9 O6 b* W' G9 l( y- w" }+ e! t  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 b, W, P9 u' r& ^  
8 C4 H! ~; c" f  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 W/ U- W8 B  [# \. n  
& [, r( Y* M/ N9 ~: N  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 q* J& n  M0 i# A
! @* o  m, r8 [2 k6 }  
# W( N) r  ]) P) j. R  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 i7 E3 ?# Z5 ]* i' v+ T4 G8 \  
& z( W0 m) E9 D( a8 e  Ping statistics for 192.168.1.21: * L* M1 K$ O# k3 @& T( h4 y
   2 d7 j0 [( N7 A
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
' z; l8 n) W- c" K1 S) q  
* t6 g+ T" x1 L6 f  Minimum = 0ms, Maximum = 0ms, Average = 0ms
  {& l& U0 S9 p( p6 C: c! ^2 |   5 d) m4 t1 B: y3 k
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ) k* t% m# y2 |0 u  {* M$ h, Y) _
  
5 A  \: `2 Z7 \- j  -n count Number of echo requests to send. , C0 y$ f$ t: R
   ; ~3 R  b  J' W# H7 I2 p6 f
  发送count指定的Echo数据包数。 5 o( B' @" Y$ `
  
9 T- j% T( C' |- d* c  j( q  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 7 B& O" r8 |3 X
   8 D* }1 @! @7 @: L0 H
  C:\>ping -n 50 202.103.96.68
( [; h& J& t% Y% }* L   8 V. k" l, v7 t. v" ]$ J" \
  Pinging 202.103.96.68 with 32 bytes of data:
3 y" D6 f3 Y% B# f  k# ?# o, o  
) C8 x5 c2 m" w+ G2 N% z% o) M! M  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ y  k* ~# [, X1 `
  
1 c0 @3 b0 s0 w' O1 V  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  l2 K8 V! H  f/ U" \+ y. O, k& c) F   5 Z! P1 [& @5 l1 y% k) ^
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( x9 z( O" M' M: x0 d
  
  A. C" R0 Y/ J0 N! N: k  Request timed out.
7 A, S' h. ?) P  
4 S$ M7 x6 d5 {  ………………
5 t0 v! _* W" w" c2 A+ F9 }     V. R) r! U( Z) y: o" p
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ p$ {/ V+ p9 D4 I$ f* s0 C   5 e) c; C% B3 c5 R: u2 `
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 H9 [  N% w& k! Y9 \- l7 f; W# T   & e0 h2 ~. w0 W9 W$ g) U5 P
  Ping statistics for 202.103.96.68:
* f' x" D5 v4 I/ }  
/ `% u$ E; c8 z4 F5 i# R/ r( `  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: % o' l4 T% d% a& p  O
   2 `& V. x" W2 _: v: j, ~( w4 r5 s
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ; p; I; ?8 Y9 E$ B: }# c* t
   ! @5 r' Q, C5 `# `6 `3 a
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 1 e3 n' U; e, T) d
   0 f$ r1 j# F& U/ Y' {9 a' R
  -l size Send buffer size. 1 r+ c, j& s: [
   ! f( L4 t$ `2 \- t3 Z3 O
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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