返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
) n* B: F* u5 O( s7 I5 {   : C9 f, u7 a" z# e. v
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
" ^. X9 f2 |6 F$ s. v% p  
2 b" S. d3 a% Y  c/ E  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 + A3 i1 M1 P4 z
  
" X. ]6 l, K2 N& c* ]* K1 ?  Options: # U, c2 v. i# b3 D0 F" t
  
; j8 B% x0 {9 p6 G  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
# I& W9 G3 C5 s+ J" [$ Y   * [1 K/ d$ g! X7 v: \# {
  不停的ping地方主机,直到你按下Control-C。 / ~% Q( P8 s- s7 o) r( G/ `& {, `
   9 K3 N: p3 K/ J( H- j$ ^
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 / K' Y: M4 C8 _1 k
  
; z; ~. S. P; A  -a Resolve addresses to hostnames.
" r" K. ^5 o7 t& j  I8 j+ x   * F/ ^* U$ H3 k, I# ^7 i
  解析计算机NetBios名。 6 c; i2 k3 U' R) I( ?1 n; f
  
; G' B: W! D* [; y: {  示例:C:\>ping -a 192.168.1.21
$ p) {- Y/ x- j7 d/ g/ ?  
" w- M; u: d+ J$ S! t  J# ]  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- D( O  r$ b7 e+ S7 q: \2 X1 ~% u  
4 o7 s  P& F+ R' h  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   m5 B8 l  V$ c( o) a" x2 u
   ; j1 k, l+ J# l9 h; F( ~/ @( L3 R% H
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' p7 A# p9 }$ E3 a# l  
1 I+ {& E& S9 h& D6 N: P  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 p/ Y2 C% ^% e$ r  d( _, ]* ^
6 t0 ]' V% \+ J' v   8 h4 Q$ E9 z8 u" P1 z* ?: Z' t1 S1 [
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ H9 E5 d7 [. ^, m1 y
  
: M( Q' Q+ W0 W. G  Ping statistics for 192.168.1.21: ! c6 a% S% T2 u
   ; @9 I; ^9 b# S! A' v* y' H
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 8 w7 E$ z4 x% e* J$ W, R4 ^" O
   ( X. k/ }* L3 l4 n2 k/ U, h1 x
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
! ~6 r  f6 J* }/ y3 L   . I1 K, O" y' `
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 J" w0 H9 U7 q& a
  
9 k5 v) k" e+ Y3 Q. k  -n count Number of echo requests to send. $ r9 C1 w, }6 |5 ~! ?' ~) @  G
  
; p' E7 r, O" ~; e) o, a  ?& [, D  发送count指定的Echo数据包数。
! j" K' b* b" @   $ c  K; [7 S# Q& a9 r! u! l3 ~
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ! w, B3 E8 m; d# z$ ~0 Q0 C3 D
  
7 I8 C; o: D) A4 r# O  C:\>ping -n 50 202.103.96.68 5 |4 u0 G* H% M4 r9 M. }
  
4 d+ q* P: _0 ?* t( D$ C  Pinging 202.103.96.68 with 32 bytes of data:
4 Z- }, s0 u( |) o. k, Y8 t   8 z6 M2 V  K5 Z; t6 X" T
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " ~' z7 l( \. E" X
   - o# H/ s" d6 p- v7 R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" n; L7 o" J7 s) ^& G1 D! k   & Y7 e% S+ D! r: ~5 p3 E! u
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 \* Q  a8 g# h; o9 g9 o3 B
   : ^1 v) ~9 q: L9 {4 g, }$ ~, V
  Request timed out.   o! H9 M! |6 {$ B5 Y8 c
   " f3 t4 q: v& K! N  V1 _6 H
  ……………… * u) M$ q5 z$ |
  
8 L( o$ B! }0 [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) C, Y8 o2 y0 M; X! O3 g) q+ B  
7 g) R$ y4 G6 ]& t3 C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' Q3 b: ]0 S7 f& R6 {8 t/ x" l2 v  
$ Z8 M5 o+ A5 Z' Z  Ping statistics for 202.103.96.68: # {. R6 i. P, B5 B& W6 `3 E
   . F4 N4 q6 @2 |! y# C7 a
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
% m6 d: `, u8 @2 i- O. f& T  
' c1 W0 E3 g3 p: q9 Q; A$ d+ L  Minimum = 40ms, Maximum = 51ms, Average = 46ms
5 C; C3 ]2 J1 P  L6 }- V* @% U  
3 j3 r" {  @6 R" f2 ?' e  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 7 f- W8 J* M$ l- A: m. @; d& ~& H  h
   & f$ G$ j; P0 O; Y
  -l size Send buffer size.
. g) R$ L* P7 o8 D# @, a, _   ( V4 Y( Q6 k* f- f9 \$ o1 ~* T/ {
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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