返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
* g/ Y5 f* h3 s. o( {5 F/ X1 S  
( o6 y7 D6 M( n# o  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ' C' q' Q+ Y' ~  g4 o
   & _; W9 L' ^; b3 L* M0 j9 Z7 o
  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
3 p" x- ^* a- ?1 E  
2 }- U" q- I1 v6 h, c5 Q* P  Options: & t1 F9 o3 s8 j
   # s% Q+ X9 F% {% K+ o. s1 A$ k
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
$ D" C' \& l7 l  
5 y" U% c0 ~! ?5 D% r- h# b  不停的ping地方主机,直到你按下Control-C。
* E8 I1 q0 a% _  
5 E& @0 N! B& [, l5 o) w7 [5 B  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
: Q  N1 ]3 L4 Z1 q: J) t& n( y  
6 r0 D* d4 y3 N1 u1 x  -a Resolve addresses to hostnames.
7 T  _$ i3 M9 V# s( R$ S   3 h5 S8 B2 J! l, Z) S) B  q; G6 H
  解析计算机NetBios名。 ! e# E; ?3 e; h1 z, _
  
9 T4 R! g& _" @! D  示例:C:\>ping -a 192.168.1.21 1 M& B' v. [  W+ ?
  
. }8 f' a% s. j  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
; v' T1 L2 o7 w7 Y' X5 b* [0 m  f   * z$ G) w0 e. i) y* d1 j
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: H( P4 V! b2 y0 o   9 N; i6 Y0 W- e9 \4 a* q$ v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# a! }0 I9 ?' r! u$ f   5 ~, V3 A2 Q: `$ T3 G' a
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 n. b1 \  v, q; m/ r1 D  |  p7 K' \( S
  
1 B5 O" T% p& L; [  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 Z1 o8 S6 g4 E( B, M* c4 k7 o  
8 y0 Q8 P% Y- r( s; V8 r. }3 s  Ping statistics for 192.168.1.21:
3 [  [6 E* J! {6 L6 k& ?   + y' I8 d! `0 B& t
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
$ r4 v6 q' f" O- |/ Q  
6 M! {+ ~7 w/ C+ A  Minimum = 0ms, Maximum = 0ms, Average = 0ms
6 o. P" D" T+ Q$ M- X   1 F  [$ S. I1 Q- o  L# C9 L+ l
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 : ^) O5 d% R" K( Z/ C
   , V# b! B* l9 v, y0 H
  -n count Number of echo requests to send.
: }1 n" s5 {' t% \   - F4 s  _- l7 k
  发送count指定的Echo数据包数。 7 t) N" D2 Z4 L3 J) c0 s
   # H$ i9 _: h- c; M! e# c
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 1 w: W$ G- f; r9 S5 U2 Y
  
. m$ U# n2 q6 ~; P3 R; a  C:\>ping -n 50 202.103.96.68
7 x# }! q% g3 F( ?  
( m/ \3 a& x5 @" P% H3 X, T3 L" B  Pinging 202.103.96.68 with 32 bytes of data: 2 C4 u9 y" D* O# ^# r
   2 S# |! @3 v  O* m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 l; F- g8 F5 ]! q: h  
) {( T. Y* T: H  ]2 o6 W) M. a  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / n: D' E1 l# g; j; G
   9 [, W# L: s* x2 E* k; A' v( n6 l' s
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 d4 ^; O. `4 S1 }1 z
  
  o: U/ _$ v) g# l. h, J) ?+ O+ s  Request timed out. ( w' _# k8 w* E6 M# Y$ n
  
6 w& c! l% O9 n% |  ……………… 2 F2 \0 |; _" C* `, A, u2 P/ G
   ) _  w, n: v. N2 V7 @  `
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 T, ^2 p8 g; y   7 F! m! d, Z/ W- Y; Z4 ~
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. e3 r; m9 A5 S: I- @   # Q# Y2 n  C7 H3 X. x8 t) ~
  Ping statistics for 202.103.96.68: + B" B: S( K, \; ^9 ^7 f% ^; I. N
   6 F* b. \" p& c/ f
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; ?. w6 V5 a& u6 H+ x! y
  
/ n% _- Z+ G3 @. d% {6 |  Minimum = 40ms, Maximum = 51ms, Average = 46ms 7 C8 h' a) d2 E! U" e: t
   9 w6 F, I# ^3 j. K
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- w/ O% t4 M1 z, ~" g- u9 m   . J: z) h* w6 G& [
  -l size Send buffer size.
. m. j6 `/ l  \3 ^& B$ j  
6 z, b# P4 E! U( T, Z6 D9 i3 J  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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