返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 % f! L8 r% F% A1 r+ G, W
  
4 I+ r: C8 p1 h: o6 a  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
9 M9 U8 s  {7 \& U( X   ) j, K" v) w1 h$ r2 s7 U/ r" `
  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
6 ~4 m4 {4 [4 U" Z7 ^5 M7 p! i   4 D0 q# j5 u5 T3 ]9 z6 R
  Options:
' X& ~* P' q/ E& u  
% C: W# |' o$ s3 Y  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 8 n/ e( o5 F* U7 ]2 ~2 H
  
; B/ r/ b. g6 `/ C  不停的ping地方主机,直到你按下Control-C。 ( w& I" J' C2 L4 f, r
  
6 _# ]- }7 W- b  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 8 _( w' w: C: ?0 O
   9 s" e7 z- U5 L
  -a Resolve addresses to hostnames. * v: E' U6 \/ A4 f7 K4 _1 B
   3 _2 |' f% L6 [/ C/ Z5 a0 ^
  解析计算机NetBios名。 3 ?# T  ]! p; h" s7 Z
   ' E; G7 l( x: }
  示例:C:\>ping -a 192.168.1.21
, W. ?8 I' @0 d/ Q4 Y5 K   3 G7 N2 ?7 Y/ H
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( D& _9 ?" `' m: g/ e$ P9 H# {
   6 ~. g- [# s& v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ ~) }- m4 S' Y  
3 c' C& A! T0 U" q5 |" S/ G# S% w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' B: V: m  v" y8 z% d   $ P; J2 K* R5 o! |# A& H
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; @: t$ }& x# ]/ P

; ~) N0 e  y' _! P8 o$ y3 @6 z& F9 }  
6 b8 v8 E! v* ?  |  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- W3 k6 r3 E. _. ]) H  
- H' B2 P. p) z( F- t$ g4 z  Ping statistics for 192.168.1.21: ( Q3 {8 t6 {3 Q$ Y1 r
   9 |' A! v1 z$ c3 L9 z
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
' j6 w% S. d5 N+ C& a  
5 N2 ~* d6 \! S- c1 t  Minimum = 0ms, Maximum = 0ms, Average = 0ms / i, d, \0 m6 P2 s$ P% N% A
  
& E1 `$ O) [- Z  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 . ]3 A& m- t5 L0 P  R8 @
   0 D. c7 K7 z# a, B/ `2 h) u# l
  -n count Number of echo requests to send. . k3 b$ e% I2 ]1 |+ V5 d& U
   ! F" c0 V# @: y3 I2 C* q' p( P
  发送count指定的Echo数据包数。
$ Q3 O# B4 O' E+ Y- C& a+ n* L4 u   * p+ t& [- N. q& Y6 h' l, D* ]
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
; B. N" S/ r  S! t0 M   ( D8 S0 M: q9 h4 t% W4 T" U3 ?
  C:\>ping -n 50 202.103.96.68
) y3 B5 y) j. ^- ]! d- {, a6 w( X  
! {, }, {  n$ N  Pinging 202.103.96.68 with 32 bytes of data:
/ H1 f( T5 q2 V4 Y   / ~) Y2 R. b% O+ \
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * P2 O8 J# T1 Q& G+ P1 \$ H# H
  
! q/ ^; V+ m! N+ n7 N# l7 y2 t  L; h  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 ]' u5 A7 J# p1 Z' e% a- k
  
; |3 o/ |" a+ Z- V* e/ {& _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 U( m4 y5 [' g( T7 U% Z7 w( z) L   + O; }% y; [% h, X  E( T
  Request timed out.
' A  I0 I, A" W* I4 b& t4 x   $ Z- U4 q. C: l6 \( S
  ……………… ' K+ O& M1 B0 m5 k5 }' A
  
4 n( c4 E/ v) X' n# w3 t1 u  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 r- o) ~6 j& X! `
   : K; T' k" ]) A( L/ j% A/ P. h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 E0 }( M6 @) d+ Q
  
! @' T& C+ y$ A4 s7 j. ]  Ping statistics for 202.103.96.68: 7 b1 S. F# L9 q' a# {0 u
  
7 R  @7 `9 G) L6 j: H1 d! ^  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; N2 d. c+ h" I6 Y! u* T7 Z9 |8 M+ n
   2 c; h/ Q& H# c) g/ v) S
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
3 e) p: N% @( ~; W5 Z+ t   , H4 x/ B' U3 i% ]
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 , Q" ^% i  |/ X5 R. t4 _
   9 F0 t& b# G/ j
  -l size Send buffer size. ! ]$ Q# I, s$ @  A# W, o7 P- Z- A
  
: O+ i& D/ i& D/ {, f  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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