返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
  P! N8 k. u, I( ~3 K' Y  
- Y+ S  q, L; A% y1 m4 O  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
" P8 t- t* Z  r- |   4 D: a3 t% ^! m& J* c' 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 ! L+ [! \: h) |; c  j
   ; W# `/ x0 u+ v+ o! Q
  Options: ' \  Y: u% \1 b/ m/ B8 A7 e
  
" H- b6 {7 ~  r. H4 K2 J, P9 N6 S. c  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
( W/ {  s& t9 J) \; Z0 i, L2 r( C  
+ f7 p) X) Q3 ^  不停的ping地方主机,直到你按下Control-C。 2 J, i/ E- z1 t
  
, h; y+ u6 Z: m6 d, e1 @  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 & w' N/ v! e; T8 g3 m
  
5 o: A) A$ a8 s: R0 o) v  -a Resolve addresses to hostnames. ' n4 z3 I9 Y$ y
  
" A1 w5 _+ l8 Q0 D1 f+ ]  解析计算机NetBios名。
  |. R3 i( R7 w" R* M7 c  
9 p8 m) e% d8 b! g; Q  示例:C:\>ping -a 192.168.1.21 9 X, a. J8 M6 i! P3 I
  
7 ?! J6 U! r  _! [  W* W% Y; X! N  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! T6 M6 U- p: @6 l   ! I0 `8 Z+ D) ?' j. r. J3 H9 f
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" P1 D# L; V6 x   * u) V! A+ \; N  e- `+ Z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 c. C& m7 R. j' b  
4 |7 {, E2 z* Y2 `( n* u3 u5 }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : ?# D# S1 Z& g' g& a0 N( e

3 d+ @0 J7 ]5 J6 o0 ^" A  
! w; y9 z- d8 }% W  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ z% g# c$ X4 j1 O* S
   5 x6 a5 X% t2 A" @$ ?6 m
  Ping statistics for 192.168.1.21: 2 |5 \! d  P. L* G) K
  
$ W) g7 I/ L- V  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: # m7 q4 e8 m" v* `+ a8 G
  
* l# a3 h, C) S6 r& a  l* p  v: u3 |/ L  Minimum = 0ms, Maximum = 0ms, Average = 0ms
  j2 q' n3 G; K+ n6 \  
! Y! [4 w2 i. B" s  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
9 w+ A3 B" B! v. G5 l  
. s6 i5 M0 Y: j' _  -n count Number of echo requests to send. 5 x) |6 o6 q+ f/ `. ?5 @
   4 |# e5 q6 v. X9 O0 J4 {! {
  发送count指定的Echo数据包数。 + G/ z; ]9 J7 J  d) x
   " O( z( _6 d) b/ q: B( Z
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 5 S: s+ c, n# E; d- J
  
+ @. D6 s# {6 ?& |6 w  C:\>ping -n 50 202.103.96.68
' f3 d$ @8 {: E7 C  
( v6 q5 P1 t7 q  Pinging 202.103.96.68 with 32 bytes of data:
1 e: r. R, Q& ]! n: o+ K2 E   8 @. s, Z* p- d' c& v. G
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   P! P8 U9 _5 ~5 |& d( @0 J
  
  h1 g. k. T" G6 H- a& r. e9 i, f  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ S( r2 @3 U; _! S4 A& J   ' A  u/ B' ?, p! z' @7 E% ^
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # L) K/ K/ A$ L) C. i
   , |$ v5 S, }  L6 n# v
  Request timed out.
3 h! o9 E* ~3 a! Z, ^5 H% f" l! c  
  O. z6 A  g6 L  D6 T  ……………… 5 b- N2 \0 o+ a, z3 Y
  
2 Y8 c3 c' O# v9 k& r4 o1 ^  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; J; p/ T5 j$ Q9 R& ~# L  T1 l   5 N3 R3 P! A" a- R$ ^# n; M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- a7 L! n1 A5 O. M0 X1 G   / \5 P6 j( E) n1 m/ m3 j2 ?
  Ping statistics for 202.103.96.68:
; \6 ?6 G2 T! ^- H   ! m6 b' O8 A, \! h* e$ u
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 9 _  u1 U. ?. [, T! X* c
  
/ e* l6 S2 x- s7 }  Minimum = 40ms, Maximum = 51ms, Average = 46ms ( _( [- A9 Y- C% M9 ]
  
7 H1 ?1 g0 _4 k  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 7 t( h; a6 l, C
  
$ @7 F7 b8 K' u! |* \  n/ j% F  -l size Send buffer size.
( L4 f+ H% ]0 A' S   + T% T/ |7 [  N! F$ ~0 c2 Z
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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