返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ' |9 j( m# }3 ?% D' B1 {  ^: p
  
$ k! j. d/ u& ~7 C7 E5 c* c  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
0 @5 T4 A) a, D2 Y3 X' a/ I   # Z# h) N* f9 F0 d4 q
  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& V) g  o& A1 G, h) D
  
/ K2 a; V8 O& s) r( r  Options: ; Q, @0 ^' e6 A9 Z7 x
  
' T; L' L; J) u# d" B9 n  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
, G% O# B, m& @, J8 M- M! W" O5 O6 T  
, }5 J+ s3 z/ l" ]; \, \  不停的ping地方主机,直到你按下Control-C。 2 y) n. a" ]" ]1 s4 r7 Q3 u
   * a/ W/ d" f* l( x
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
% c1 V6 W! p% L1 @   3 ^+ ]! Z. V6 w8 n5 ?* v
  -a Resolve addresses to hostnames.
. m& v1 H' _5 T& K  E& N" \   0 W; d; s$ [$ l1 h; h/ H' X
  解析计算机NetBios名。
  J5 M: n3 F) b! J  
9 @" \$ U4 T% H6 _% }( N  示例:C:\>ping -a 192.168.1.21 * Z8 B, D7 O' r& ]! q5 H
  
4 c9 g' u& }% h: T. u6 I  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 ~3 x" V# A3 a   $ n( K( `7 n! n. t- C# N1 i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # ^. Z' v. n  v6 o+ ?
  
% @! x% P7 k% V( h, G3 _  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & h. ~/ G1 j  ?& s1 V# ^: |: Q
   % q; H0 }9 J+ @' C3 Z5 c
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; b8 ]# B0 t+ @( @
- e( z+ c  D1 y3 P9 H   : d  |4 Y# c* P& \& y# F. {: n
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: x( J1 y% T, A$ n" ^' A" |- e( H  
* g9 k; s- O  @- k7 Y: D% Q  Ping statistics for 192.168.1.21: * g4 \9 r1 r. w- l
  
" n' S/ F# P4 R  k8 o! S  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
1 k( d0 K& d) Y6 y! q1 U' `  
! j1 z9 o) M2 }+ U  Minimum = 0ms, Maximum = 0ms, Average = 0ms 3 L. h& }4 U$ k0 j' T
  
: K  Y+ U1 k0 n' R6 t  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 . ?/ m9 F% @$ M6 X
   ' j- F: {! j4 e1 |) i
  -n count Number of echo requests to send. ; p9 Y+ H! W9 b! T- }- @# I
  
  b; `2 e8 Y4 Z- t, }  发送count指定的Echo数据包数。
9 i5 w. ]7 }' g- l& E. S3 t  v8 ?  
. M3 C# A5 i; b( n2 b  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
/ a7 c: I( f2 `# [- U   * G& s1 `4 f! N, H
  C:\>ping -n 50 202.103.96.68 7 }7 K5 w9 J$ U$ x" Z
  
. b6 E- ?2 ~. h8 S2 W4 V  Pinging 202.103.96.68 with 32 bytes of data:
8 W$ e0 B6 f/ {& t+ U4 {  
0 x1 @0 Z& K$ p* {8 R$ u  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : k: p: y1 d' ]0 |, s4 A7 n
   . ~# B; e  X# P8 K. f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 _$ Q# J; _( O
  
/ g$ c! d4 A7 S) s/ p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 n# j4 H+ H# [4 i7 |, }  
, X& G3 x+ M4 V9 @; ]0 g1 M* }  Request timed out.
3 r. U+ u7 k9 A# T7 f  
1 L. ?4 M) s& U' `; Y% N  V9 ?  ………………
/ ^& A3 [5 Y: E+ @2 L! a  
# O8 z  ?  O% ?2 Z( x6 T  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 ?1 j  U  \9 Y0 M1 G  c
  
2 ]' D: g8 p% d$ p! O0 P# K  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& B% d! E/ E3 F  
- g7 x& v; m" t* O  Ping statistics for 202.103.96.68:
4 q; r, d' z+ [$ p; u4 |! c   ; p- t1 y) v2 h% J8 L0 J
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: $ ?, i2 R% L0 T# V
  
8 b" R( N1 E9 `  Minimum = 40ms, Maximum = 51ms, Average = 46ms
: m# k5 L0 f+ q8 s! _  
7 `. j# a0 X& n! @- Z, R; h6 o  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 " ~& ~  h. g" c) L
  
  R6 b7 F& H* u0 g1 F4 h  -l size Send buffer size. ; R8 i) W2 D% f, ]4 b5 ?
   ) y5 x+ v- `5 e9 S; V
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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