获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 - c( c8 S1 E' A3 `% j7 I5 _
   9 V) M- H# C" u" i/ H
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
/ X0 N/ r- O# ?4 p# U   3 t4 ~# `9 n/ a: E' W0 m9 A
  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 N! x7 J9 b  |3 |
  
5 O( c0 C( l7 I8 Z. k  Options: ' n6 a  {- Q( S. c
  
( S1 ?, N. ?8 \" B/ a6 A  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
' V0 c, B5 ^: q; m   , Q2 I1 j' e6 M
  不停的ping地方主机,直到你按下Control-C。
9 P7 R2 h, I& H7 B  C  
8 Y" U' a& }* [; A( c0 o/ }3 ~" }/ d) j  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
" x* _$ W: B. g5 C* ]  
" J1 A3 L0 C" G5 w+ {4 D5 ~' \4 m1 B  -a Resolve addresses to hostnames. 5 Z$ Q4 x) B  Z( R2 L4 n# g/ K
   / M; x) }6 N: K6 X7 t
  解析计算机NetBios名。 9 v  ]: D7 m% b- r! S+ p
  
0 D# A3 `4 M- \( X; W6 s  示例:C:\>ping -a 192.168.1.21 6 N' J1 P: O% g+ l) r  Z) w& @! Z) E
   1 S  ^! \5 o( E8 c  y+ z+ O' b0 l
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 0 V, ?! ~2 j" `/ b7 M
  
  L4 J& l( U0 a/ F  a( `  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 W# a7 @& m. R+ E& @% x0 b
  
3 X: ~+ h6 B/ H  q# Y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' I4 Q. S6 t$ @. r0 u$ N: O9 k
   7 n" @  A6 Y: V4 `
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' F4 O7 S& [2 i2 g4 s

4 G4 W3 d# _2 a0 A) J& b   7 K/ g" V* E  i4 L' @' \
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ t+ y" Y5 K- G2 `1 q   * X. }# I+ V7 A6 j: w
  Ping statistics for 192.168.1.21:
; t- g6 P  J* T, b  
" l2 {& _6 h! t  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
' w; z& o; J: T; h/ P   # }1 w" U, K& w2 m$ A5 c, z8 R
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 2 j& [* n  @& D# _1 g  V
   " g0 Z7 V4 M7 m9 t* R+ O- }- k% i" z
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
& G% Z5 \! j7 ^" o- i  
4 ^$ }" X$ V7 v& t4 N6 p  -n count Number of echo requests to send.
% Q+ L% S( B! ~+ B9 f  
! \2 y9 M' R0 S7 u* ]  发送count指定的Echo数据包数。 4 H' \8 j1 ?$ T4 b6 x
  
' V8 p2 ^2 f: K3 s. m+ _' `. q  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ( Z4 `. J* C7 i' L; C. B) x4 A8 K
   8 B5 ^+ G# C" Z: ~8 |, U
  C:\>ping -n 50 202.103.96.68 - {4 i% O/ ~" b
   ( O2 }5 o% z/ q# n, y3 p
  Pinging 202.103.96.68 with 32 bytes of data:
: d) [  @6 D# d  T, [; r/ _0 G   7 e2 |0 J# d7 V) g$ `# G
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% ^2 g# h; _9 S6 [; _3 X# J' v  
& g' p3 ?3 p/ y  G( [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * h  d7 |" O3 ~8 i% b
   ' Y) Q) @. c$ E$ H8 r+ _7 C
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 e. g) [) a2 q# C  
! a4 `* ?% F+ `% E+ o$ x  Request timed out. 4 C. m: }  A& R' W4 R
  
+ w- E% M$ g7 o$ z  ……………… ! s) A5 `9 }+ O& U1 ~
  
+ \: @9 m# J3 B9 W" A  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( ~' d3 O5 d5 ^4 v, N
  
# R/ w& r% e( W3 B# o3 n/ x  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 \4 h8 R4 G! K& x8 d   # s6 c! _0 p2 z! a- N3 p
  Ping statistics for 202.103.96.68: 1 g9 d* Q4 p+ L
   8 E8 z, Q) o- a; N7 ~* g' E
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 9 U, [) ~1 c1 n& q. [# S
  
  G: v; w# \5 v' K, p, n  Minimum = 40ms, Maximum = 51ms, Average = 46ms
- p  L7 I5 b# n4 H- s) j% w  
1 @5 T) a! T7 B7 W& `3 n5 r  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
3 D' o5 f: U. k% m3 ]- b- p   1 K% h5 o& T! G& h! i- {4 B  o
  -l size Send buffer size. ' ^- n9 M  z5 z2 i& D- s) k
   9 v" Q  ^  n! h' R7 R! }
  定义echo数据包大小。
89w.org捌玖网络

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