返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
5 N: ]8 V! n% m# i* ]   / M( `8 g! c/ r" A) \$ W9 H
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
/ l  q1 z2 K7 W  
2 ]1 J6 `* l" z8 F. H  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 , l1 {# Z! N# s# l% V& w0 l
   + X$ R8 G0 Z- `" J' r: {( t1 r1 `' @
  Options:
# D4 \5 A: Y- O# `' u8 j  a   $ A- m% I, r( R
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
2 @( Z. E5 w5 S   & W8 x6 h( f6 c0 p
  不停的ping地方主机,直到你按下Control-C。
6 H8 R) l8 V# p7 v  U9 q3 {   / y' e. h7 w% ]/ q
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 ]8 u& ~2 z4 }* q
  
; u* i( k  @) j2 P. H% N  -a Resolve addresses to hostnames. 7 N  _: _. S" ~- d9 a# O
   1 t) _7 F( p0 Y; a0 v. }% `" c
  解析计算机NetBios名。 2 p! y! q$ E" y3 n: l, r2 D
  
# n& Q8 Z$ H: a1 g  示例:C:\>ping -a 192.168.1.21 5 i6 ^1 C: _9 }# f# _0 {
   ; M  a/ U5 s8 H. P% r3 P; _+ |8 r& h
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
' x9 x" F0 O+ `0 t# |0 w   , U& Z+ d* [" h3 A' T
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   a- p7 f7 m. _7 ?3 c- a
  
5 n! h" Q$ t- v9 M' k  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ p, ^8 _6 x6 D, m# `( B  
5 ^: H1 e* M5 O8 L" g2 d  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 p7 [7 f. Z! J1 n6 d6 o- K1 g/ f2 w( W4 V$ v
   1 u: A  V* f+ D$ S
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * o/ n! i/ x" V* J- \0 P
  
2 H6 s' }, q0 u( |3 J" J  Ping statistics for 192.168.1.21:
9 C6 p% f/ s+ Q# _  X   6 f5 u6 c1 `, Z8 i
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: + k+ n: V; S& A5 G4 i# F" x
  
! S! ]% X0 Q. p  L5 J5 S  Minimum = 0ms, Maximum = 0ms, Average = 0ms
" Y" _% b( g# h# X  
2 k* T" B& A/ H1 [4 O  J5 D& N: z+ ^' U  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 8 j# F8 a" b* {( s3 U* ^* v
   , V$ T* P3 Z- Q& Q: W! e( D
  -n count Number of echo requests to send.
- S$ [- X+ D+ x  I2 n+ ~  
1 N- [& }( S% P) ^# V8 Z  发送count指定的Echo数据包数。
# c5 y  A* R3 j/ _. b& C( d  
2 x; g/ H% L- l, H' @4 F, I+ ?  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 1 \4 D7 l1 h2 B; o* E# I! U
  
; e* `! L# w% n/ v0 `; c& Y  C:\>ping -n 50 202.103.96.68
, f7 S7 ?# k* B' @  u  
! q* U0 U% H0 l" b5 H- {  Pinging 202.103.96.68 with 32 bytes of data:
7 c6 q. l) E% l8 }4 E" q  
# n2 s' U/ z, j+ {: }* F/ _. W1 Q" f  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & n! B" q1 z4 P
  
) D: r9 q, Q9 J  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - d/ C* R3 i* ^) [
   / H: |! Y2 U5 `# j/ s
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   `( n& {* e5 f4 }# o
  
. k( v" {* ]* f3 X  Request timed out. " L' P6 x$ u1 I5 W; j. j3 z1 W
   * I( Q, K' u/ e! f3 f
  ………………
5 m# t1 H( x3 H0 X   , p" {# E$ F" @9 Z, r
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! z3 K8 T: C# q( E6 [4 \9 ~  
& h; Q+ ^; I; }2 T5 S1 O3 B" u1 a  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 L1 P# \1 z4 P$ T; G
   & Z/ B( Q  s' ^( b# d2 E
  Ping statistics for 202.103.96.68: - F% w! R: |5 O) D" [6 [! t8 `
   % Z% Z8 J% [; O( `6 N4 x, `
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
1 m! _0 N6 P$ o' ?, b6 ^! ~1 P   9 `( J+ F0 w' s3 M
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
+ a+ l# L$ D9 Y8 b9 K. V   7 ]! Z5 Q( ~+ H* S* U
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
! i' _8 s5 ^( E   " R- e! T7 M3 Z  F, _; ~$ b" F
  -l size Send buffer size.
* o7 H' ?! N/ I3 G$ \0 Z% W* ]  
  G8 T$ x+ l6 e7 V6 h& x8 q( v: d  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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