返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * d! `' O' c+ b' B7 j5 j
   3 s  g5 ~7 u, r5 o1 x# U
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 7 m2 }. F' S; P2 C* X! v
  
, m+ r& T3 [) 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
( G- H9 S, C- d8 {% r4 q   8 |3 C% ?8 S. X' p4 b8 P
  Options:
2 O, `, q0 T! W0 V2 ~  Z* W   " ^: [9 x2 z6 M3 x4 Z: |
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
& Z: a" n6 O- p" E& h  F( \     C/ G9 ~& i9 C8 ^6 A
  不停的ping地方主机,直到你按下Control-C。
* ]( z5 Y7 L$ y7 K  
/ ^: K' K: v" ~+ ~6 G' t# X  C  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
# L! m& a+ X0 Y$ N   ; I: T# n; C; I8 @8 j9 o2 t7 V+ z) j
  -a Resolve addresses to hostnames.
1 c" t" p! O. F" g  ^5 t5 ~   + b1 G2 b) D: T1 }/ B( p+ ?" V
  解析计算机NetBios名。 % {7 {- v0 K; [1 g$ Y: @8 F
   # T/ X% c! \: n7 @
  示例:C:\>ping -a 192.168.1.21
0 n4 M, A( f: k& h- V  
( l; o) j; _! v  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 w" f/ S- F( w7 p% _! r  
" j2 S5 b$ c8 i! C% Z8 L' _, V+ _  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " {6 p* O7 q. y  e+ d/ c9 g
   6 ?! J: x4 y, O$ B0 r" N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 r7 L' C. o7 T4 w
  
$ i/ v/ t! m6 i& b9 v& O. F( }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 E! K: f) `# B5 S' ^

7 N4 c& F$ A# X   % {; m, J/ m* Y! o) ~
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) r# e! j: a9 K
  
' r7 \9 m$ D; {6 A# b  Ping statistics for 192.168.1.21:
% m& R8 U6 m% N0 k   2 h6 c8 L  A0 F
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
1 Q4 I. U, x5 g- @% {" N' {/ x   / L& Y" D5 p# Z% L# t5 [
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
/ j( A* c8 j- F1 {* e/ q  
: `$ I) u8 h; x( k$ O# `2 p" i  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
4 P/ ~" f  d! f) Q7 }# T) S* j   5 _) H2 I) C6 K( [6 a
  -n count Number of echo requests to send. - x% U9 a2 B4 x% v: J
   + I; r* P/ f% U1 H4 u: S
  发送count指定的Echo数据包数。 ' s3 ]$ x. y1 [: }7 C4 u
  
& u" k3 h2 ~" k6 l  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
6 o! B4 l" U9 q; T9 Q2 c   / t( _3 d% o2 v# ?( F$ ~0 w
  C:\>ping -n 50 202.103.96.68
8 t8 g1 @: p* P, [# R  
' n2 T, W3 j/ M, R& h+ g( l  Pinging 202.103.96.68 with 32 bytes of data:
5 L* M- b0 q7 L2 v" }+ n, N   6 ]$ X' Z! M  I+ v2 u& R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   {# @/ U' g: |+ w$ w
  
# @6 ^5 W# E! Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' |( N$ N6 x" k# m* K- v+ R& I! C
   % x' E5 p- x7 K8 r( s( }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / X0 v+ b- F' [9 P
   3 w8 N' D; K7 Q5 L+ c! _
  Request timed out. 1 a5 B: U0 N9 V; k" D6 Z9 I
  
9 Q" w% b+ _: }, M- Q  ………………
% B/ P6 W( s- {* B   # D2 F4 K- R8 b; V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ x2 k/ t+ B. h" _   % k( [8 `! |* E/ C' _) O1 A, B/ y/ r
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 f2 x! l8 C. w4 w  d! j
   3 p6 V  s3 @+ K: Z" i" k
  Ping statistics for 202.103.96.68: ; Y* A+ ?4 M% L7 Q
   2 ?) {$ K5 ?$ j7 Z4 X; e+ K/ P  v, U
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
) a* p: U/ D5 A   , \& s2 K1 J5 |6 N- L8 `
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 O, e& K4 C9 @: |+ q2 L$ n* H
  
7 y  a' h$ _& B# Q+ X, m  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
8 I( k. S2 }7 H( p: E1 l  
8 j, }8 \" a4 w! M  -l size Send buffer size. - j5 {  @& T- C0 C$ e& N, l
   + U9 T9 c2 D: s: Q# Z
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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