返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 / H7 G1 f9 p* L0 u' w- i% V5 q" O
  
/ v& A. B3 D" `2 J  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
; e7 Z# H# x$ K) W6 b6 R+ ]) `1 C/ o  
: \6 L  y3 j0 J3 r$ }  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 : h  d) W! x; m
  
' r0 C' E9 |, b* m' j  Options:
- C" ?2 a9 E( X0 `6 g) L$ _$ p  
9 ^  N% b# k  G6 G  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
2 D9 v0 w& s8 H   - l* R7 _& O* W, x" q) a. A
  不停的ping地方主机,直到你按下Control-C。 , o# |' X1 i! e9 r: c
   5 N7 b6 U8 G' |( V+ s: I
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
' W/ s# H/ o# _: p. d8 h+ j( z  
* N  r8 C4 x0 V$ \$ ]/ `9 H  -a Resolve addresses to hostnames.
7 R( d! m2 e, d4 D+ C  W) |3 L2 X# M  
4 P$ Y4 ?+ e5 C  解析计算机NetBios名。
# o7 q* B& Z: i. p, p   6 J( `/ [0 I- p1 {  x9 l
  示例:C:\>ping -a 192.168.1.21 0 }% C; ?. C  h
  
4 E, v$ \. E4 `4 g  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
7 v# R/ f  Z5 ?& M- e9 i  
2 ^: {9 f; U% c8 O$ g8 `3 c: D0 A  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' Q' A; x3 |5 x$ H& d8 o  N* D  t* C
  
' [. y2 x+ m% j5 O+ T; C- |  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + l( Z, E6 D' B# x5 O* F4 @' p5 b0 r
   : H$ F! P. F$ F# A+ I2 {
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" K  s9 v7 ?4 ?$ S: |, s; n! U" _. D2 T) t! M6 u
  
0 J7 l4 v4 V4 d$ j2 \  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ y% {! t6 i! c4 r3 y- D# g+ n* I
  
$ Z5 R; S; F4 S3 d  Ping statistics for 192.168.1.21:
$ k9 {$ r6 U8 D5 x/ b: ~  
  J' y& }  Z* _; O- J  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: / g) E$ h! s" v! f  X
  
* v% ?* a; R7 I( ]. r5 s  Minimum = 0ms, Maximum = 0ms, Average = 0ms
2 i; |4 @$ A  a4 a3 p. ~0 _1 Z  
; s; I( T5 L$ A, h  ]- {  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 7 N8 s% g: X9 c
   5 y6 c, {# b; |8 t
  -n count Number of echo requests to send.
! ~; _& p* K7 |+ v! w   * W- X4 u2 ]7 l4 Z  z
  发送count指定的Echo数据包数。
7 s9 B' I5 `9 I" [  
4 B' K$ ?/ l" k1 t% i  C  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 7 h) `, r3 b! I6 P  z# s
  
. |, A8 K% q, I" f  C:\>ping -n 50 202.103.96.68 # ?3 p& l4 ~( j+ q1 a
  
. @2 n. C6 T4 b- f: `+ h, a  Pinging 202.103.96.68 with 32 bytes of data: ( \% p( s9 O( K1 B2 P. I
  
% E# K3 Q# ?' J. q  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) h$ ^. Q) |/ i+ W8 |% \
   7 q! g2 D. H2 e% J4 i  E; O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ b* t: W% a) ^7 ^
   # P' H6 x! [& A. h1 ^0 L; U
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( B' Y: `- _4 [: q5 T) d/ k  
) G" C  O0 {; y8 w8 }# l% R- @. S  p  Request timed out. 6 _5 ~2 f9 `) \7 j( t. R" H
     W# \8 w+ L9 n7 D/ o) x
  ……………… * ]- b0 T8 N* T3 q, I# ?7 o( J
  
2 _; W, i$ u" C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 z  c6 Y* K" ]
   " h1 `7 H0 @% |' W4 D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) D1 n# c) P' r
  
8 Y1 B9 e% m$ x* z* p3 F8 Y  Ping statistics for 202.103.96.68:
+ D7 y9 @# U1 E4 g6 Q( ]4 o( B+ c  
" Q3 A( R4 W8 n$ j% ]  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
. L  w7 I' P9 G  
" t7 _- k. n& }  Minimum = 40ms, Maximum = 51ms, Average = 46ms
: w5 r, \8 [% Y5 A   5 Z% b7 }& w/ k% w5 O
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 $ Q" y  p  u. U$ ]
  
$ B: D" r3 S9 v; b) e! E( F% S  -l size Send buffer size. 1 p9 ^9 @' R9 g; ]* M; f9 N
   : r' _0 w" U( n/ E' v6 z
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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