返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 7 G* h( X; j& p. o: k" [: b
  
  C) g: {$ K/ T4 H0 A  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
. f6 u: n0 p4 S/ H+ Y0 a+ t* K   0 r$ z3 K, m: [  x% Z+ S* Z
  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
$ @& O3 K- P: i" s  
$ Y' ~  B" S0 |& r  Options: + z/ y" k5 V- H$ x
  
) \6 D+ @+ X3 R2 x: F/ r  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. + W% \$ L! O' L
   * y  L7 J( z, ~2 }
  不停的ping地方主机,直到你按下Control-C。 ) T. V0 C- w1 E+ F5 ?6 J$ J
  
4 E6 _/ L% u3 Y6 U  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
; L( H! W3 B* \- v; ]   " d# A9 ?: b7 a9 \' k1 m
  -a Resolve addresses to hostnames. ! R- X8 n7 h# n. I" m
  
8 H5 n) Y0 w' c) r  解析计算机NetBios名。 ( h' y: Y& I2 I, B4 y" z
  
, I# R* x8 |, P  示例:C:\>ping -a 192.168.1.21 ) h! x$ N' t4 j8 F
   ( Y" ?7 a. Q. b: W% D  y
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: / n; u3 w2 S) h
  
1 z2 m* h1 m; R  W  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 c  A% b0 \! d0 b/ y& t% Q6 q  
; F0 w5 e; o, }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % f8 @/ B9 p/ `) @" j1 c8 H
   9 @1 C& n5 _0 T7 Z  _+ I, Z5 i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( r4 f/ H  ^; Y$ D7 @  E
* L( I0 x0 [7 |3 ]
   8 F* |8 F% O) _6 g% E
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 d6 ]9 {( Q$ N  
2 s- c# y7 d; v+ {/ h4 C% v  Ping statistics for 192.168.1.21:   d- k  `9 m4 V
  
9 u: G% ^4 {( b+ C4 D  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 A; w# l5 ]; s   ) u' m. V( J; p$ m) i& L
  Minimum = 0ms, Maximum = 0ms, Average = 0ms   a/ X" U+ ?8 k9 ]1 O
  
6 p3 @5 e. A# w/ X  u  \: \  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 , w0 j+ z! e1 O6 l' a
  
! O/ b& e. t; F. C: ]  -n count Number of echo requests to send. , r+ o, e% S$ `
  
0 l) p* y" u/ r1 I  发送count指定的Echo数据包数。
; l" `3 h7 u# Y( ?! j  
0 U& o, t+ m/ m" S/ T4 V5 O4 {, V  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
3 U- M: p( n2 l0 q! x9 ^   1 E' G. S. @) v$ U3 h$ r* K, e: C5 r1 E
  C:\>ping -n 50 202.103.96.68 % e3 v" U# i) }7 O$ o
   # _  a) p3 p% u& f: a
  Pinging 202.103.96.68 with 32 bytes of data: ! v# G" k& f; `& a) s$ e
  
/ `0 `$ U9 \/ o( Q8 `  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   U- ^/ A/ p% \) a
  
. |* S) x4 v7 N; j0 V$ z1 R  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' n  H( ]4 ~+ S   ( a/ a: F8 M9 s# E2 Z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! o' x' U7 Q- ~$ y; c
  
2 f. r$ k5 E$ u, I1 [+ X; c  Request timed out. 2 _9 z6 X4 W, U" }8 m
  
1 q: M+ \7 C! [# s2 b6 w! M9 b6 d. P3 g  ……………… - H/ ~8 j/ M+ R, T
   9 d, p8 s2 d: U" P3 T$ \
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 z8 e3 Y9 A9 W: p   $ @  e  L+ m5 x/ b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# n/ L% v5 D% S" R& ?* z! U  
7 z7 J' ~1 F, x+ u% A! k  Ping statistics for 202.103.96.68:
# ^+ @7 b' J& g6 e! e  
" |% x9 p7 \( A" B. X  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
/ p7 G& G' k. j% ?7 y2 P   ) J* b+ z$ f+ Z" n' R' b; J5 A& _
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 8 O* {9 q' j# x0 H! p- @
  
" Z# d) U2 V3 I! l7 R8 W0 b9 p- k  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % ?0 V$ A3 |$ Z+ ]+ @' }
   ( G; a, Q* l+ T, A- x9 Y0 x
  -l size Send buffer size. + A" I! N  I7 M" H; L* x/ W  q) ~
   / x6 B/ Z7 v. g8 Z/ g
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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