返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ' y0 e7 Z& w; ?2 A( J  u! L# f
  
4 a# F+ K" p# G; ~  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
# E! J# z" E" ^2 Q   . x4 a- U0 X7 X# E
  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   ]7 Z- |8 e8 U
  
( a1 P3 n! K$ E1 n, ?  Options: 8 H0 F! o1 C" s7 ^" N3 y9 |6 x% A/ G8 k
  
' L* U) V. }+ c% {. e) H$ F  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 8 J$ S( p/ V- H' R- E, T
  
& T# L( e( ^2 T; l: A/ b7 B7 p  不停的ping地方主机,直到你按下Control-C。
2 e0 \' V$ H* m* y* D2 W7 A) L! y  
: f; r' T0 N: ^- k  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
& e; X5 l% {% j7 q9 t0 s) ~   , p& c9 a' t. F
  -a Resolve addresses to hostnames. 5 p3 F; g& s7 {  m# H
   ( P3 i+ l9 T) `5 T9 J% u
  解析计算机NetBios名。 ( T  n# ?9 F/ l& t* a
   : Z  h( L! R: K! C$ u
  示例:C:\>ping -a 192.168.1.21
  r: K$ S2 i6 A; ?9 t9 O   ) A" u/ |5 I/ r1 M/ A# s9 g! r+ t
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 [. f! V# x, R' Z7 }   & }, ~; D+ F7 A1 Q- \9 Q" i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( r- \) i+ K4 C' F  
4 F8 c! N" y) H  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' a8 B4 L$ e- G  A& z: [  
. W6 l$ W# F# Q) t% f4 z0 s  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / R: f6 v. o; t$ ]4 b( w9 g

9 w8 r1 \3 y7 g   # m% h) y. S' z8 Y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 ~, b" `3 b- t) v, }5 M# @7 E  
- B2 A$ [1 w: e. O% j: b7 L2 P  Ping statistics for 192.168.1.21: 9 n6 \1 w1 I4 {
  
# V1 f) ~- ?3 b  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: * U4 v+ ~' ?6 w$ S
   ! M5 ^4 B: ^+ l& |# w' V! {
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ; `& P+ u) t7 }8 J! T
   ) q) G; l# P/ R2 r) p5 E2 ^
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
$ \. H; |" e/ Z   ' O2 x: r! @* T% s5 {+ w
  -n count Number of echo requests to send. 3 r, h8 R! B( B% m7 d
   . g+ n- r0 t8 X  j# g: v, T5 V( ^
  发送count指定的Echo数据包数。 1 G: H* i! C8 s( ]( i
   / T$ R  m2 e9 Q" Y- u
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
( D5 l' J8 T) S+ N$ y   # j- U% D' }. m! h- f: k
  C:\>ping -n 50 202.103.96.68
# \! R0 Y3 K' g  
+ @; J- P9 k1 D$ Z, h2 ]5 |+ u( q  Pinging 202.103.96.68 with 32 bytes of data: 3 F& S7 z1 M# C
  
: o# r# S+ m% `' e  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 V% a) T- f; x+ V9 _
   - e9 R& m; u4 q9 O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , V, ^9 c5 ^' J( t2 K) ]
  
) I5 M+ I# u2 S2 w* I& O, r; m3 K# E  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ N+ C  b) t. w  
. {( Q& n4 H4 ~5 u- O# \1 \8 r  Request timed out. 8 f, _. F( c' j: k8 P1 S! M
   9 E4 y  P6 p+ h9 n; {) L' \, O" {
  ……………… ( K5 g5 V' H: D3 N9 q! F
   ! ^9 _# }( O7 j" h! F- I0 N
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " S6 x9 v, {6 u7 M5 K# i
   - V# P6 [- u* T% ]) L/ ?, W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 P) n' I: O- x. Q, z8 U8 v
   3 G0 m! c6 w7 n4 w& H* A
  Ping statistics for 202.103.96.68: 4 `, e" p" E& b0 h% _6 @
  
( N8 t/ E2 B7 l3 [  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
/ [0 q' I& P8 _$ T  G% ~' T2 H   3 f8 o" z7 b  B: J6 B
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
4 I1 Z+ K8 m1 m* d6 w2 n   3 i5 l' N/ a; ?. b' R2 _  Q/ {
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 3 H! O$ T6 }( [
  
6 B8 E: f/ c: @" Q  -l size Send buffer size. ) b$ f$ u4 B/ W; h' x3 \$ i! z5 Z
  
! ]! T% v+ E. U8 t! q  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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