返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ( A6 q( \# {/ D3 `5 P
   . k3 W! ?- J: O! C, ^% `2 i( J# X) l
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
- E' y4 E5 W1 d' h$ u- R  
; C' a% P2 U) _+ G2 R) V' ]+ D9 W  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
0 M. a4 H, e' f   6 v" E0 a6 V/ V9 _0 I: M% U
  Options: 9 U! A- J$ `' Y1 @2 @* }$ i
  
  n) y7 n9 A+ \0 h1 H" z/ d* s  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ' a8 e  Q- v7 i# h" I, a0 m" A" l
  
: _( K5 a! w8 I+ U/ e% @  不停的ping地方主机,直到你按下Control-C。 ! U" U- y% R2 A0 n# E
   : P! ]6 z6 ?/ i/ O( W) f6 U2 W$ @
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 $ H/ v1 G6 g; r- `) @. b
  
$ z/ O8 s; s4 Y  -a Resolve addresses to hostnames. 3 s% A8 c0 T0 |# Y/ ^& ~( _
   4 w) k  A, F% j, h1 O) U* D- r8 Q
  解析计算机NetBios名。 ! k4 L1 ^5 q0 _; n/ k5 S" ]
   ( |: f6 o7 e3 Y9 W, O" v. v
  示例:C:\>ping -a 192.168.1.21 , \& G! j! F% O, {/ Z8 R
  
2 Q0 L/ H: {' D6 V  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: - C. n5 s' y* W) S: b% H
   1 g$ O( g0 `; ~6 Q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % d8 o4 @8 @9 P
   4 f! J$ m  a! r4 N  u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  J2 t0 N8 x- m  
. c) k3 h4 b; y  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 x9 `' h( U) n: l; r7 g$ @& X' m8 S
/ O- ?3 {! P! d/ x
   " ^# J6 O3 H% e2 ?" Z; |
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , o$ Z) |* t, L4 O* }4 H
   # C. `* R" e% @% U0 I: g
  Ping statistics for 192.168.1.21:
) B* Z; V' D' E9 ?   4 ]. S: b$ ^+ A$ d2 _( I8 h
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
1 {& w# m: ?! `. L0 M) x- j  
  m; G* U& E; y. K% c$ H$ y  Minimum = 0ms, Maximum = 0ms, Average = 0ms 8 p" w8 l5 c. m+ y3 t
  
3 \9 w- r! L9 @: P/ b$ I( G- U! U  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
$ N4 c' d$ u! b) N% q) V   1 _9 ?8 ^0 P4 h2 z6 h9 O( i. q. C
  -n count Number of echo requests to send.
9 t+ r% l8 \9 _7 ^( l7 U  Z   * }3 s. U4 ?' g( I
  发送count指定的Echo数据包数。
5 O! O0 w* a6 i2 ^7 n* j+ g/ }( |9 ?3 i  
4 a# x  K  J2 F  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
2 d/ ]; I8 Y5 J5 b   & V6 N# G9 w+ D; T
  C:\>ping -n 50 202.103.96.68 6 y8 k+ @# g' ^9 \1 E
   ; `8 [3 a- s" B9 ]# y# Z- U! ~# w
  Pinging 202.103.96.68 with 32 bytes of data: ; n% `0 a, ?2 t1 w
  
3 S' c& h, m- S) C; U6 e3 i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 S/ y# b, E) H
   # ?: F- O) t1 O3 L' T/ G
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   u3 V' q6 M/ O" \* m
     k4 P, ?* A9 q6 l0 q" x  ]( b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & ?  A! ?9 H% q1 e+ q
   ; E) A; E3 s, j2 ]; y" m
  Request timed out. 1 b; h9 _" ~9 M4 N; G7 X# R1 x
   3 G. J- l$ ^! j) b0 m4 V( w7 [
  ………………
0 l% ^- Q+ Y6 d. p8 n   3 z6 h$ S, E9 b
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , e) w) p/ C) {' x; w2 {/ j4 O
  
. W! ~$ j) m; b1 h) }; M  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ P0 E: w# @) O/ M+ ~
  
) B# |1 E9 \, c# Y; r. _$ H  Ping statistics for 202.103.96.68:
; o2 y2 t' `3 ~1 x. A  
$ e8 U) Z" ^3 Z  a$ S6 N  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
3 D4 B# `7 q4 F! a" B  
% A0 a; t1 r$ U$ S  Minimum = 40ms, Maximum = 51ms, Average = 46ms ( j# n, c( t& p) h
   8 h- A. N! D1 S% K% ~) T; L
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 7 D' \3 l  K: u' U) k5 R
  
3 U" q% `# f& b9 j/ n  -l size Send buffer size.
# r0 f& [  @  a" o     L; f2 [# c5 p$ Z6 H) d* Q
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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