返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * J! ]2 i2 s! S" O6 z* d" L4 j
  
. p) p- x$ L1 d# o; u3 v7 l  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
) }: G7 G% f( z* M6 M7 W  J3 T8 v  
# c) C- A7 T# v" I, g; }  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 2 n5 ~* R1 W  H# P2 Q
  
8 K, i& I" J' R3 O) h1 L  Options: % X- c- `6 b; W. \6 \! {
   $ P2 \8 g6 a8 Q3 I+ V* j
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
- O8 r* Q' G: r: d1 {  
) k( `+ O% T% V9 ~& E# m# J  不停的ping地方主机,直到你按下Control-C。
0 Q" m0 h( n6 \  
# ~( G8 t/ _: f8 v, C: E' F  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * ]' S4 `. f, l4 P8 @: S+ p
   / P3 Z( _# N5 v" P5 _
  -a Resolve addresses to hostnames. & t$ R2 {6 g6 ?# C5 ~
  
5 e, V  U% z$ H4 d2 R5 J; H3 q; G  解析计算机NetBios名。 0 d/ }1 ?- s" }2 [6 Z. z% h/ f
  
$ z0 N+ D' }5 P! F4 [1 O9 B6 u  示例:C:\>ping -a 192.168.1.21 * n) h6 j% r, d5 Z& Z2 ?
  
6 Y. s1 ^: `% C+ K% Y2 @4 _7 B3 }  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: * S0 Z2 C+ c* P9 R0 r6 B
  
% @7 h1 y* i, P7 I  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 W2 ^4 V1 ?0 I% Y; R2 E7 Q
  
- E& U6 F- |5 o  [# J& W" G9 q$ W" M  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 K. g( h" {  d3 B
   $ _2 z# T" S4 \, U& P+ e: i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- _0 [5 q( N8 B8 ^( S* ]/ f: l+ a5 V6 ^5 e0 K( K- l
  
0 r6 A! P3 j) J( t/ r3 n/ G  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 @( b8 o. f$ B: q  T: ~; F8 p  
: A( A6 W5 q9 ^  E  Ping statistics for 192.168.1.21: 3 c  N4 b; e% ?; F
  
4 y& k/ }. h- u8 N4 i5 u5 |  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: $ B% Q% Y9 m( G4 ~5 i( [% T( D) F
  
' f, {5 g- ]- X* E  C% c  Minimum = 0ms, Maximum = 0ms, Average = 0ms
6 n2 C1 o2 K* l* v1 @  
: u/ `6 @. K3 N% r  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 & b5 q$ ^" B6 c
  
% G0 D' e% t! S1 |5 Y# |8 x  D8 W  ^  -n count Number of echo requests to send. / N+ ^6 @& c9 g
  
- x! _3 n. u' ~' k0 |) T& W) h) K  发送count指定的Echo数据包数。
+ H) q; }8 D, r2 I! [  
; B( Y! N/ f- v4 y# r! [  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
+ k; \6 d' G. L  
8 T& W5 r" f$ v$ w; s  C:\>ping -n 50 202.103.96.68 7 X; [- B' a9 q8 d+ U9 E% b0 V
   & Y' x7 ~' I! }6 e
  Pinging 202.103.96.68 with 32 bytes of data: . A7 T1 b) @9 g2 A5 s+ w5 r
     Z1 |2 E1 q( O) H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 `: h9 \" a- R9 R" J   ! [' q0 _) G5 q- H# Q  B/ }  u. q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 w- l) V  V, J8 n' V, L
  
3 J6 X8 f3 R, z8 p: N/ i. W$ {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 E  {3 E( q, j  r  y7 l0 p& X  
/ \( ^8 R3 _0 m- x9 ~0 H8 C  Request timed out.
- q* \* l- `# c( A2 `; a" ]2 D   0 V- _0 G) k: s# W8 Z/ m. h5 u
  ……………… ( \! n1 S  R* u' }1 s6 w
  
( H6 @  Z8 v, B  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - N# k: ^2 ?7 q; d: ~7 `( l
  
9 W1 i0 e) R% O0 ~7 j3 D8 [* x  K  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* h: |6 d4 N, f0 ?0 `. S$ d" y  
% l! g# Q& d. `5 i1 ~  Ping statistics for 202.103.96.68: . n$ y2 r8 z7 {  @- Y3 H
  
# B" h4 d7 C/ B# |4 {  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
; Y7 \! o+ W' @/ @! X4 d! r+ m& l9 t   ' A% X. y7 F+ Z6 F/ ~( J
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
0 v& K$ `' N5 U! |  
6 c3 b. H5 }7 \/ u/ {7 j  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
) @" l$ H% ~  J4 C% L8 j. g; j8 _   6 w1 j1 R* }' H5 H8 B2 m3 x" h! w# J
  -l size Send buffer size.
9 a* }4 A: F' u# L" S   , R5 k' D9 X3 z4 ?( {7 ]
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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