返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
+ N/ I3 M$ ]( r9 c( T4 I( O" A  
( C5 C# D& p8 \5 Y  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 5 F* |# a' t4 K% k- a8 R4 Y
   7 J2 q* d9 k' l6 a) B
  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
# B# g  @( H' E* ?0 y. S% g' @  
' d0 R# \7 E! ^  Options: # e) S% r. @3 B$ T' L4 [
  
) U: p0 G8 v2 Q- W' w9 e9 [  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
6 i5 g7 W/ e5 b# u2 E% y% x) y- i  
& c! @* U" E. ?) s  y* z  不停的ping地方主机,直到你按下Control-C。
2 \- a0 f/ P% x4 [" q  
9 g/ w4 W0 Z, d1 ]$ h% X* b  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
! L: v/ G0 c4 ^0 [( r  
7 e; _1 A- f" f! L2 r* S$ o; R; s9 P  -a Resolve addresses to hostnames.
  h. T$ v( _9 r: Y; u; _  
3 |' [+ [3 O3 u" |# T1 G$ F0 l  解析计算机NetBios名。 8 x9 \# Y* T$ C) f
  
8 C+ F# h: v! Y" g. ?' x! e& K! l1 U  示例:C:\>ping -a 192.168.1.21
' n6 ?# B; Q' W$ K* y# E  
0 D! N1 o" n, k4 A; y3 S  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 }2 P" v8 a3 M& B4 R* v   ) ^* @* ^. q0 C1 G+ V
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" y) B. M0 Z  C+ D/ a: T! J     |% t0 I. a/ u  A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 P1 j: E8 J" m   . x) \5 D. `1 u- S- t$ A$ z% X9 m2 k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( L. g* G5 a+ o  d2 Q+ t

* n0 x! C  O* h! g' ?  
! m( ^  [& y8 A+ m4 L4 z6 R: {  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) `8 C: E1 I4 _# P/ n( N
  
% u4 ]& y$ p$ {7 U& h  Ping statistics for 192.168.1.21: ! F7 b; R, p& z9 ~3 \4 U9 D4 z* F
   % N) X* J8 f+ L# u2 |- s
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 F2 u, t7 O# t* g   " [4 P6 N: p. H- ^7 C( L  {" ^1 U% h0 B
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
+ j2 o  P+ V* z   ! \! F" A' i* T8 u: Y: X
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 9 S6 ~" m* U6 Q. M! P: J/ q
     b  p' S, Q; x! M  `" G" S
  -n count Number of echo requests to send. - w. Y$ x7 @% L- {& [
   & O0 `) a9 B* o
  发送count指定的Echo数据包数。
' r) X, E1 a2 w# \+ w   - e! X  `; _" P! H6 D5 T5 S& c
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ! ?+ N; S7 z: y7 c0 e& H$ z
  
6 |1 |- s  s5 n" m7 X3 ?3 M  C:\>ping -n 50 202.103.96.68
( I% z3 U6 q* z0 }! x2 o8 t  
; o5 e) E/ g; m$ B$ n3 x% {  Pinging 202.103.96.68 with 32 bytes of data: 9 W; X. m  G% S
   # P4 R4 n3 Z0 G+ O6 k' \5 T
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: h: l3 }% d% t  ~0 C) B  
  Z! X1 N2 M* f! A* `* y$ i! d$ X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; B$ U- L7 p0 ~* Q* v7 F2 ^
  
3 I' B6 K7 G8 B  z% {8 ?$ Y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % O& ^. D' Z" Z& ]) t9 T
  
. r5 y. @4 Q/ t  Request timed out. 6 ?0 G! n) M/ g! _+ d
  
* h* j) S( v% Y. Q  `+ k  ………………
- ^+ ]% J; S+ M- B6 m* _  
1 u4 o, v- n2 _- P8 F+ o2 f  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ u: I- _" p/ b$ _* ^( l! w" r   ( _+ D; I, F1 m% W+ y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( q+ X  K5 V( |( i! g6 t  
1 B' x8 O+ q# ]  Ping statistics for 202.103.96.68:
- V" H- `% C, C7 b     M8 I% V$ R+ d: L
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
# o* s7 a+ ~: F8 i/ e# y   9 l' b- ^0 {, p, M. j; L
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ) U) U2 ?8 B6 [7 @0 m
  
# a% t  D$ Y2 C/ ]  E# ~% v; u  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ' l; j' e- X  }+ Q6 ~4 X8 B- r
   & P6 n5 x) j: j: c* w$ |
  -l size Send buffer size.
% @  j" ^3 i0 z* E+ t# N% S   # S0 L2 D) }; w# ^& ~( F3 d
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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