返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 # @" O; |# }2 ]" G8 z
   ) d6 K- n) u6 g+ {3 l0 ~
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 3 Y4 T/ p) o! w0 D3 Z' W
   4 Y2 h* G' H2 W" p5 O
  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
* r1 C3 i4 h! h3 E: N' D; p  
3 X. R1 W* H8 L! x* \& O  Options:
4 t& G$ h  v5 O) L8 h, \; L   ! b8 J6 e7 w2 z' j$ t
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
8 }# a. f2 X: z9 o  
* ?, I; H0 ~+ V  不停的ping地方主机,直到你按下Control-C。
/ U6 k$ c2 B4 _% e; P! z   8 N. V! h8 U/ h! G0 Q: s; }0 v
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
3 m7 |5 [2 H, t8 }& ^0 P* ]   " S0 Q! R4 [4 g1 d+ B
  -a Resolve addresses to hostnames. ( U/ R3 Z  l+ p# A+ I* G
  
9 ~( Q% T$ _; ~+ e4 o; K$ P  解析计算机NetBios名。 , ^8 x( N: d9 B# V
  
' j9 Z: U4 ~3 F# K9 Y  示例:C:\>ping -a 192.168.1.21   c7 f) U' J; f( f# C: m
  
7 ^- I* Z8 }% G# u9 [' a9 ~  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
8 L& k' S+ X" v% U' g  
$ f  W  T7 ]- j, k. c$ \  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( z4 {1 _! O( _/ W; v* O   # D& T6 R7 E# n. g( ^
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* g" [( U. j5 h! i   $ Y8 I6 M2 T) J9 L+ d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( m- P  L( C& t& V3 P
9 l" l; [8 ]9 C2 L! @  
' u1 F7 u' s: ^, m. ]  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 m" ~$ r% K, S! s2 ?# n* u2 C  
, S7 y/ j7 n% N* D& X  Ping statistics for 192.168.1.21:
2 y  t, |# X; l7 N+ `+ ~8 n  
! q0 G6 X. h8 i4 |" q$ w8 ]3 V  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 d3 y$ x; m  ]' f# O$ u% Z# E
   + n& q1 X0 S, o- {
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
$ ]0 Y& Y3 u5 x- |. L  
, n8 K# s1 e" O  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
  F# O4 L: F/ l  
- C2 O, Q7 {: f2 f" }2 B7 x7 K! \+ o9 d  -n count Number of echo requests to send.
* F/ E2 L, |* y! w- {1 u8 J  
; o/ t+ e' L' s( [2 r  发送count指定的Echo数据包数。
0 V) M, U& f9 F# v) T7 `  
( L  V7 K- t- ?: Z) i$ x* O  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: + g% r; H% [) ?% c" z0 Z9 D/ z
   3 P1 v  A. p! S& U
  C:\>ping -n 50 202.103.96.68 : H5 R/ @# k, K6 ?& f
  
. s4 N/ s" e- o+ n- D4 k, z$ W  Pinging 202.103.96.68 with 32 bytes of data:
" M; [) n1 g0 M5 i& Z- y& U0 m2 q% \  
* [* C% }; }/ Z. a" l) H8 l  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% X2 J( k  f, O, r, t) q; i2 p; e  
# G$ n6 r3 ~) M' A  C9 i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 k( X( n( S2 h; Q  t% R- f  
1 O9 ^; W1 V' S" O1 q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & J* G0 l7 g* M: i0 h, ^
  
% ]8 r: |1 D2 w8 \! Y4 d: u  Request timed out. 2 M3 v- B! F: x( ?$ e* }  ~7 I
  
9 L- G9 c( S! p% I6 l: a  ………………
4 O( i: {1 [  \" d# s* g$ g   ' Z% O" M, f1 o& G5 P: H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 K3 {8 V3 Q! t! G) ~0 l  
. C, ]) A# L6 [' x6 x  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, }/ [: B1 e  |, |- O* I- Z0 |   : M  _7 o' U& v8 v$ v! n5 m
  Ping statistics for 202.103.96.68: ( t0 m3 w( D; L3 U
   - Q/ |$ M+ c/ B& T5 p1 ~7 L
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ) p3 `9 E4 {, x  u$ r1 c; ~
   $ Z- ~2 }% {7 D+ J7 u, Y0 ]3 z; R
  Minimum = 40ms, Maximum = 51ms, Average = 46ms * E5 l( x7 X3 I& O1 F3 p
  
$ I8 V& Y3 Y3 ~2 y5 m  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % j' t0 v' Y( L9 O
   4 Z' B6 Z- p3 {) R" U+ X
  -l size Send buffer size. 5 y7 c  q# h$ d! `! ^4 |
  
; b# C) D7 F& U" G" ?2 S* ~  v  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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