返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 % D1 T- o) w9 V( q5 ^! g
   * G% O/ F% O( F$ ]+ O3 o) H# w' N
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ' \) [) h: q: \8 u! W
  
1 @$ i& U/ b, z8 e+ l  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
% ^4 b" j( O. o6 Z9 [9 r3 }' h* [/ h  
  X. e4 H* ?; X- d% V& h& {/ U& X+ e  Options:
" A9 s: Q# f. Z8 B; {0 |  
# r* ^+ C7 B4 L. ~. D  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
- w  \) s. ]# ?   ( u$ Q# b3 ?- l1 ?; J6 {0 J
  不停的ping地方主机,直到你按下Control-C。
. l( v1 C2 }. T$ w) d. V3 D/ K# ?6 p  
  ~  a+ o1 |3 o& B, \- V  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 9 q, Y/ W! Y3 E# F  b1 I! j
     X5 A. x; U$ x/ [- }# V! ?
  -a Resolve addresses to hostnames. * J0 J* m" }4 o7 t, |
  
0 u: H, S. a/ ^, y3 B  g  解析计算机NetBios名。 7 Q1 {; c. ^$ h$ d; w. i
  
9 n8 M5 V; h! r! h  示例:C:\>ping -a 192.168.1.21
6 p4 c0 I' s4 A; s/ e% \& N  
; H/ c" b' m) M7 H2 \  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 5 Q: l& j5 p' I
  
) R2 r) N9 G+ r' }; P  C2 [  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! ~/ _& D3 d- f: l, q/ Q   6 G- m- N* V( z5 {- p0 E
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ k8 M+ S* o1 Z* j5 c9 w  
; ]4 P9 w, M" {6 O$ b, }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 ^3 e+ G" I; @. h1 b

! V0 K2 w3 h! u% @% h/ V- A! s9 m   5 c' @# N9 {0 |7 Z% K2 K/ |* t; F
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 I( q& D# Y' f2 g1 C9 p   % J6 _% i6 `. O
  Ping statistics for 192.168.1.21: - R7 I  O' ?5 t& D7 q; G
   " x9 ~$ [4 ^: p* L& `
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: % S  C1 l1 N$ B
   2 [4 `9 g9 s: {( r3 U
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
& t7 X# f, s& p( b; b4 @  
1 W7 Z+ i. `! Y8 G! v$ f  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 $ S. x2 N! @, T2 x
  
' z: \( ~0 j! x1 d! H# @  -n count Number of echo requests to send.
! c6 [- Q& V" c/ e% C$ Z6 L  
4 K0 D7 b7 O0 W; q  发送count指定的Echo数据包数。
9 ^/ O1 @( O+ t  
6 V9 g- r  _: [5 L  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
* D; t# f, y! i" z' Q   0 M8 t% @- z9 Q% e2 a
  C:\>ping -n 50 202.103.96.68 ( Z( i0 |, z6 q& O) l* L  x
  
7 ^3 w. p6 p/ m  Pinging 202.103.96.68 with 32 bytes of data: : E+ Z5 \: G4 u' E4 c/ g" s, \
   + ~: X; |  J, k/ k/ n6 h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& ]1 l  Y- O' F- N' @1 c   3 u' W2 D+ [# A
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 m# x0 E( |; n, ]5 r( E   ! u; W0 c1 w- l" E+ S% H
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & ]' T1 m1 [% F- ^: f7 N
   " `7 c2 _; h% i5 R) L' a
  Request timed out. 7 P1 }1 ?' {! n" ~2 R
   ( F4 V- v# M. Z! x
  ……………… + p5 e0 ~/ @( q1 A) _$ l6 B6 e
   ) o, h+ P  D6 P) @3 l5 ^4 G
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( c) [  [* O" @
  
% M, K! M; W( }6 k5 r  {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 F" l$ k2 U; v! P) c4 P   ( [( D: ~9 g; \) D$ y$ y
  Ping statistics for 202.103.96.68: ) U6 L# ?: [. t3 h7 d& j' {, F8 e
  
0 ]/ M/ e5 I4 z  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 6 N" N! b5 X, U" ]# D3 q8 h
   6 v- C, M; V" n9 H) u
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
' K! f) n6 f. u4 d" \. B' K) u3 j+ b   9 f  F4 Y% @; [, q" Z8 j
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
' n, [1 U/ V( u& s/ ^, n8 y   . i9 y9 O3 T! c# {% {" e
  -l size Send buffer size. ; Q* C4 u0 i* m% V9 \& L9 z
  
& S# o+ [* l  I  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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