返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
& {' }7 _$ K, l2 N; B/ Z1 c1 P! U   ! [; A3 V- X2 ]  q5 |: ]- `
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
6 x5 ?/ A, P2 p: [2 y   2 T- x" r" f6 Y% C( T% s5 q& |
  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 # D3 L! j# d7 j( z  {7 ]
   9 P; [: Z* \/ s) f5 g0 m+ y+ I- W, j: [
  Options: . S' S# V' n2 r: T5 b
   ' A* f7 k7 T" M8 R1 i
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 m6 l7 C, |/ i: v- c3 n
   ; w( k) Y6 x+ `
  不停的ping地方主机,直到你按下Control-C。
3 M: p* B% E2 }+ {1 ]; E7 ^( K  
0 @! C* G: \% J8 E' N$ g( C  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 ~# g& b! ^. v; P
   # \9 T  P" u- h& C/ i6 l
  -a Resolve addresses to hostnames. ' W/ d: g+ w% J8 a: ?5 k
  
( V; h; ]3 {2 G  解析计算机NetBios名。
" b, ]2 d5 C3 ]4 m# z' d& J8 _   9 M9 N" p- F8 K
  示例:C:\>ping -a 192.168.1.21 2 b+ j* v* ^2 |; v
   * ~1 H- r6 D- y4 [- `1 _2 m7 w
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
* |4 c* r4 `3 I6 n  
! a& \( I+ {6 z1 @' a; V  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' _$ E7 K/ N: O% o8 b  i   : S2 \) _& b, a. j% v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ K/ J& r0 g1 I3 w1 g+ ~% R5 Y0 `  
/ H/ [! i  _$ b& e  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' b1 `/ v+ I* i3 S. @

$ D6 d' T/ @1 V1 E$ _1 i   ; O( q7 Q2 q+ }* Y  r5 ?! }* ]
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * _' Y- {! K2 J0 g
   4 `+ M( Y; f/ t
  Ping statistics for 192.168.1.21:
9 y; J7 j$ X* ^- D$ L  
+ y0 [/ }5 l0 n* e/ F& k2 j  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 U% D) p3 s. U* d+ @  
9 B( E) Y. {0 t- K2 ?4 u  Minimum = 0ms, Maximum = 0ms, Average = 0ms ( m# u: R  C. V+ p
  
; g3 {. f3 i8 |6 T8 ~2 q  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" i: E! A3 K. H) _7 M   8 M# a! N) T' l6 h
  -n count Number of echo requests to send. / R$ [/ G/ X" p1 j% t
   . u+ v1 r# a0 G' Z
  发送count指定的Echo数据包数。
8 }) v4 h, L# G( k/ B  
3 A( g1 G& X- G" q9 M  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
. B+ M; M" O( `0 t) [. O) `   ! m7 j$ I% L# ~
  C:\>ping -n 50 202.103.96.68   B& T. o9 }$ e4 i1 P, R& E; b
   / x, c3 g- b7 @& ^( @/ _3 Q0 I+ `9 z
  Pinging 202.103.96.68 with 32 bytes of data: 6 L! g8 @% D, f/ _" R4 L" Y+ Z
  
+ _5 g8 L4 x" v( L) P4 k4 z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: q* V  m7 m6 ?' o9 ^  
7 n( o4 b) ~# r  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : \% c: b. @2 n3 A/ j2 E, p& U5 E
   $ M" u. W) g' D# u0 \" P
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 Q* k9 K* P  f, n# J: H     ]" N2 ~1 I* G8 [
  Request timed out. 1 D( M8 b( Q* ~0 l1 F
   ' P0 T  V5 [* ]0 p7 Q
  ……………… 0 l! b6 A) J  A( d5 H
   & ?) h$ J; q6 R( m6 {' e8 ]0 [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " I# T& O* {  x- x% o5 X) `" U! q
  
: P) Z" n. o; {1 U* [6 `  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ h/ {: D, q( @! {2 F" D   ! O0 P9 M3 t3 V2 j0 h, F8 G
  Ping statistics for 202.103.96.68:
, I3 i' }1 U* N5 o9 m$ S& F( j7 [   8 K- A# i3 ^, z% q! g
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ( K' r# P4 H. }
  
9 g& T/ i6 t# O/ w- ^' H  Minimum = 40ms, Maximum = 51ms, Average = 46ms
0 ]8 n+ s. y; X( R1 h  
' U9 g6 b& x1 b  q3 Z  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
: e2 m4 I2 G% R8 X) p   1 V& m5 u7 o( J& j$ Q6 S, a
  -l size Send buffer size. / y: [0 |. _' R, d7 @) z
  
2 @5 f- o8 @) j  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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