Board logo

标题: 教你正确使用Windows的Ping命令 [打印本页]

作者: 野人e族    时间: 2008-1-27 22:16     标题: 教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 / Y. O+ H1 Y; S+ w
  
) s7 o& ^6 C" N! z$ F3 y  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: . `* e) e0 U$ y8 U
  
! L" y2 q: g! }  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 Q2 Q6 W* _$ F4 T( d9 t
  
1 `+ l% U* t) M$ G* e  Options:
0 W! y3 k& }" ^# `# @  
3 y5 W& X6 d' K; A* j  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
, P+ e; ~( h$ V  
2 g) c; y1 H$ t; A# p4 I% v  不停的ping地方主机,直到你按下Control-C。 " J( V/ [% q- N8 D9 e' I  R  F
   . M( c- b0 Q- C" C
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
! y1 T( Q2 x  L  L4 X$ M  
' H) H2 V, a; `, K  -a Resolve addresses to hostnames.
4 t) ?7 G" `$ |% P( ?   9 E' i, w$ J. B+ K8 p8 g! j; z& M
  解析计算机NetBios名。
3 ^: E5 R8 u5 I6 `   ( h% Z8 w. |; O4 ?) x4 Y% R& l# a
  示例:C:\>ping -a 192.168.1.21 # ~, W: C/ B; ]# [+ W# D% u5 a9 _# A
   9 n" d  T3 H0 T
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ) f4 s3 A1 Z" k# [
  
1 E9 Z9 H% r3 f5 Y* O  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % ^  j3 Q- O( i3 F  t" ]- c
   - d# C, ]9 d" V* Y" A4 ^, u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! t2 R5 L0 f3 D; |  
2 O# T  r" f; o: s$ N, v  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: }8 Y* N$ J% r; v& h$ J4 j, h  {# h
  
/ _/ L9 G' K3 e1 ]. B' `3 V  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 S/ Z8 t6 O" _4 C8 O. U' w9 a  
. U! ]" T1 r8 C* x" e& B6 h' w( D  Ping statistics for 192.168.1.21:
8 n: A* f0 G9 N   ( \' x5 r0 @; t
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
% R$ I4 j9 k+ v$ U( X  
* i- Y7 k2 Y1 Q0 C  Minimum = 0ms, Maximum = 0ms, Average = 0ms
. l" v* c+ n" o  ]   2 l% M, `8 H3 A$ C4 }
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
. e0 W9 c  U9 f( p8 @   , n( ~5 E, O6 M* \' r
  -n count Number of echo requests to send.
4 @4 s, {+ s1 j5 i- d% f  
; v* E' f1 l2 O  发送count指定的Echo数据包数。 + i0 C, V9 ^2 R9 [* m: R' |8 l1 t
  
5 ?/ G' D* u. Y; k  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; _  s3 T% k# h2 w' ~4 n
  
. z5 |: F- v7 u( [/ O. ^  C:\>ping -n 50 202.103.96.68 8 I. A" ]8 Z: L
  
7 K% s. |! A0 M. E0 g" l, R9 ~/ A  Pinging 202.103.96.68 with 32 bytes of data: ! p& f  R9 z! f: U3 D
  
2 T& \; N, T- }  z' |5 T* W& T0 |- M  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & D$ ~7 z8 V* Z! h  H
  
3 V; U0 V8 s, f' j6 |" _! n  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . M5 w6 a3 Z) d) }
  
' G* U* U( w! L* [9 J. E8 U' C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 F! Q, A% X! j% F+ G# `* `
  
( G2 Z4 B7 l' _' Z: w1 R" c  Request timed out.
7 \, K. ]1 T' {3 A- i' i   1 I+ c2 @# `. y$ d7 L: O0 Z
  ……………… 5 Y2 J: E- F! Y0 m
  
0 C! R: Q3 I4 P0 M& a* f& N7 O& O  T  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" z/ T+ g  Y) {- k, e   ) [2 f/ b# R2 w% W  T
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( j6 R9 P1 U; A* [# z: M8 Z* o
   ' r; q6 V( x) P6 r4 F+ t: I
  Ping statistics for 202.103.96.68: / S9 l5 ?6 u) W8 ]( U$ E
  
8 a9 Q1 O' ?5 p, K% N8 f6 y  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
5 I: w3 w/ I7 ~7 e! T- w- s1 w1 m   7 E1 C+ N( C' [; c) G
  Minimum = 40ms, Maximum = 51ms, Average = 46ms / {3 w0 }( }$ v8 r% F& p
  
: h; [# I6 S4 t9 [8 \  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
1 e4 _) H- S- E: j' U- A8 @   6 B0 S/ t* V4 c4 u3 x
  -l size Send buffer size. / a/ q# L2 B) n2 h- C
   # m, L+ L, f( s
  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




欢迎光临 捌玖网络工作室 (http://89w.org/) Powered by Discuz! 7.2