返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 . s* [$ s& U$ `- U9 l
  
2 ~: ^1 s0 L4 a1 N: L  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
# ^9 J4 v' J0 U/ \* E4 A  
  T$ m; M8 @3 W5 k9 d8 Y, P  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 & \+ k) [/ t) P3 ~( x9 e  e
   + I7 i0 V2 `" n5 n# Q1 ?
  Options:
  [% `/ u" F# r. _- l. [& r   8 b- `5 y9 j6 P' d4 N! F, I
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
# h! r) s$ t  A# V2 B- N- \  
* O0 x( n) `8 {/ h6 J  不停的ping地方主机,直到你按下Control-C。
) W' O% j! h: {7 y  
. o2 c0 i- A- e' |. E  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 + O& q- ~; Q  r3 j/ G. {8 U- t2 D
  
, E* g: G* |* h  -a Resolve addresses to hostnames.
( b# V$ G& ^& y( b: J6 H# M  
. |& S7 _0 _2 P# Y3 ]  解析计算机NetBios名。 2 C; I* j; q- B( g8 H
   4 V+ t( ]- z% r! ~( X6 U
  示例:C:\>ping -a 192.168.1.21 9 U; Q# [( w) m- P) B2 l
   1 V  j6 h3 B6 D, [/ R
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , l! E+ B% ^4 F: Q% @
  
! @1 _; U8 E/ p1 E6 Z) k+ ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 {. a9 G9 ^5 S& X   * l  ]8 O8 i% P) F4 O# M: [4 Y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' k# @( W) b% a
   ) ^# o, O9 H2 E% a
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# x- h8 x6 d# c4 p0 h
& d5 s" g+ {7 O! k5 u. H  
- F4 K6 _9 r% }9 I4 q* w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 X+ x0 K* v3 {* S/ {. M
   " T( M' [% {: `6 y" J
  Ping statistics for 192.168.1.21:
: y4 j. _+ _& y; t* Q2 @   8 y0 O( A5 G7 u; L9 R6 ?
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
0 a! v; }4 C8 C* s0 q6 P   - H+ Q4 a& [# L: f
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
# v( ]5 r/ M( D  Q  R   1 k* i" |0 \- J3 b
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 9 n) a$ N- v& Z0 |, D% m! A; h' {
   + N" L% z; Q4 E% k9 R
  -n count Number of echo requests to send.
$ g' ^, X/ x6 g% t! V   ' C& ~0 i6 Y4 ^$ k5 U6 q# ?+ N' w
  发送count指定的Echo数据包数。 . J2 S+ g' N; R. Z
   / w1 \! p$ o# `) {5 e
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 3 o( w5 Z5 l3 _4 I( L. W! d
  
: l; Q- Q0 g" A" e' @2 M2 G" l  C:\>ping -n 50 202.103.96.68
# K" Y. ~; Q( N( Q6 _" g1 r5 `   5 Z3 U& V/ t  F" p, {$ H
  Pinging 202.103.96.68 with 32 bytes of data: : k( @) [/ H  X  G" m, Y
   8 G5 l9 Q9 p4 H( {. p+ F( @; x
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 P( b0 W* f$ t# Y4 _% f5 b  
8 @! W; l' G1 \7 L; v( [  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / w7 l1 Y, N9 \* `, H( ~; B9 p3 R
   3 f2 p& z. X7 ?: i" A! S& Y* ]
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 R% }: Q8 `& F! f  
6 t6 {0 g/ S' s1 P0 P7 a" c  Request timed out. 5 q! i6 S" S: b8 {
  
4 C. ^& k9 d( _1 ]$ Y9 S5 g( F4 G; \  ………………
- P4 R: T/ g0 _) z  
9 O% z) F: Y7 y) d, |* H  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! _1 f9 u1 m7 o+ Q; l   7 z5 @+ M3 Z- a9 y  W! t0 Z, A# l
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * G! @) t" @6 H  L  p6 V' ^
   # s3 u: ~4 [2 ?3 {
  Ping statistics for 202.103.96.68:
1 E" s% I) G# t; c0 J) @   8 w+ i' ^# p9 Z5 ?5 H1 F+ O
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 6 `- ^6 p+ H$ A7 m
  
' u, V6 W* {* Z& \0 F  u  Minimum = 40ms, Maximum = 51ms, Average = 46ms
1 s' W  L( w5 N/ U' V+ |  
4 A$ i# n8 x1 b* w  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 , s7 Z5 R& j( a  \: j
  
5 ?. p+ K3 I  n9 V- o  -l size Send buffer size. , z0 N+ ^& n: i  M) u$ M/ s- I7 Q
  
6 `; L$ ~/ l: Z9 C' a  `, K  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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