返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 2 X9 x0 d; B& l0 y; s
   + q. o' [7 n  {( K- F6 \
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
1 w# L3 z* Z6 ]2 E* `8 T3 o  
$ D8 ]# w  w; B" V) }  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
# [1 B( J0 h* {' @4 n1 H   9 A9 R- i1 s# M! N! Z, i
  Options: 7 J4 M8 n' ~4 V2 q5 c3 @
  
; h  X; v$ |1 T/ E, ~) L9 y  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 9 O( [/ j0 j# d4 s+ |
   " S- ]5 ~0 ^# o+ c5 M
  不停的ping地方主机,直到你按下Control-C。 * R/ i6 G+ i" E5 x, U/ H
  
: @; |% i3 B/ @; }9 m( s. e- x  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
" x8 F! H- {* a: }9 |   & ?; m/ l% j/ p3 b% n
  -a Resolve addresses to hostnames.
4 j0 O2 o( N9 B* i) }  U: w& M   ; `3 L9 O& N/ L0 j( [- L
  解析计算机NetBios名。
; A( h) X$ K. F: ?3 a; i# w   7 h: S  \) \- p) S
  示例:C:\>ping -a 192.168.1.21 3 u" ^2 y2 Y& b
  
5 g0 A7 f) g8 z7 Q: x  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 6 M7 W& S1 X- R6 k, F
   - t4 @5 b  }$ G3 g! J/ o
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " \& T1 J5 N- p+ @/ B1 R- u
  
7 H: w5 k# ]$ S1 X; Z5 s2 }$ n+ z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, [  r1 l' P9 y& C   9 c7 g2 o! g) J4 ?& j+ @% c
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: |, r* F$ E2 B+ |5 n+ p5 S" D- A6 c; A' `
  
! ]  ~% Y; _5 x: K* h2 R  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 P, J, ]8 O) ]& n6 U   9 [; i( l* i2 b! p* D6 z* Z9 b4 V( |
  Ping statistics for 192.168.1.21:
# Z0 d- ?% k7 B, g0 a  
! u9 _; W: G& m. p  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
) v: r9 d; X9 V7 C  
( U: ?) n: u& O) h7 B$ ~  Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 q2 _+ c2 m0 D9 J% x* l5 M+ d
   * k; q" E+ h+ V. m
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 . @( u0 L$ @7 Q- d
  
8 _& w; z2 l8 q# F: h- |: h% E  -n count Number of echo requests to send. + m" A, `) C0 G1 g) A  M! E; L
   9 E0 B- a7 {! B/ P% |2 t
  发送count指定的Echo数据包数。
0 }$ C2 G8 }8 X# l  
. I2 m5 {  l. L2 e, k+ F  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: . ?' `/ o0 ?: U- {1 f
   3 p, x/ R* Q' Q2 Z+ d' N
  C:\>ping -n 50 202.103.96.68 ; h( N1 D3 t  M$ L# A+ V6 f( P) w
  
( E4 |# B+ d( D, r) n  Pinging 202.103.96.68 with 32 bytes of data:
" T% u+ P* K# v( |" m) k  
- |: i. x, G! e/ e  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 _1 }% m9 d, ~1 U4 B
  
* L  p  l, ?4 ~5 d. o  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& X+ T1 A+ P. g+ d; h   $ ^5 Q4 {/ l" Q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! n) g2 K4 Y# d& n+ v  U   7 ^1 s3 W- \& Q( U7 a3 l8 ]
  Request timed out. / U6 P* ]" }) {: x) y, R6 @
  
% H( p5 i2 K. Z# }  ……………… 2 T9 @/ j2 J1 Y# t
  
- a# @$ S; ]" x  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : t% [$ H5 w. P. d+ q: f
  
, j4 w  C/ M5 G; N% ~2 s: E  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 C' F' ^( v- u; n1 ~7 L, _1 [+ C0 G
  
# E1 K8 Z9 B9 {0 J0 Y. E& S" h  Ping statistics for 202.103.96.68: ) n$ V: f& u- o& n4 x7 y
   5 K+ i+ B8 p9 f+ m3 B; X0 [
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: + x- x$ Y9 Q% L( x6 j  S
   2 W5 ?( P7 r4 T2 W5 v  ]* J
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
6 `( \! C+ B3 M/ E% T   # T4 z/ A0 F+ {* @1 e' p! o
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 0 r( E0 j3 w: g; W
   ! ~  u! I2 g* \: ^
  -l size Send buffer size. 8 K+ e- f4 q+ x  K
   5 t( p4 W1 {* G
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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