返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ' Z# c9 S* N3 b3 C4 g6 z/ U: G/ f
   5 u1 i' I5 s3 q7 k, L9 i. Q  W! ^
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
7 ~# g* r6 T1 O; F2 c: D$ }! t2 i# v  
# e% s6 a- F/ Q( Q& k8 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 h+ ~- u# M/ W. q8 b6 @, n- n" L
  
1 t5 K- K) a- L3 k% V1 ?& x  Options:
# V+ o: ^, K3 Y  
/ W$ z$ i7 w! [% |1 i: k7 e6 K  X9 p  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 C! r7 k2 l  o' c& W; U. j' p
   % I; O! z6 ]' b. b
  不停的ping地方主机,直到你按下Control-C。
1 z. y2 q  u9 g! T   0 ~; N& u7 V2 i% y/ G
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
7 g; o2 }# P, S/ P+ v& w   % W" D- p6 d7 i" e3 P
  -a Resolve addresses to hostnames.
" S$ s' M5 H9 \8 |. P5 r4 i   8 Q3 P! l2 L9 u9 I# Y
  解析计算机NetBios名。
3 X% V  J$ I; o8 O; q) j- O   " O; f" `5 b; x5 g  q0 Z
  示例:C:\>ping -a 192.168.1.21 - u7 y0 H! T) |( p8 V3 y' t
   ; y5 e$ s# |5 _' g
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
+ c8 {5 i; j7 S; X$ u- ?  
' U2 X* p. P; T6 {  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ ?  }- E  Z4 j   5 ]9 F" T; [0 Q2 _: @2 ?; r4 u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 D% `4 }% n. [: W  
; l, h5 X) e1 M$ i  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 `5 J$ Y. m" c
, [5 {" [' Y5 I6 n; C* X# W   0 L# \) r: v6 w/ @0 P" }
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" o# W, U2 L. J' @2 @; Q4 u- A$ T! b   0 a/ y% H: g( G0 D
  Ping statistics for 192.168.1.21: ; m1 p5 `1 k/ T$ V3 S4 Q
  
5 v! t$ T: d% k& s! p  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
7 H" V/ c- z/ M3 c1 Z# n, @  
1 p2 l) X: \9 B+ }: r  Minimum = 0ms, Maximum = 0ms, Average = 0ms % C6 d6 [+ Z1 h. J/ D, `
   8 @, N! }9 D. z7 m& H6 I
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ' C9 g. C% a; d9 B& o/ Z
   * d' A- `6 d$ }3 r& j
  -n count Number of echo requests to send.
8 N1 {+ O. n9 j+ m  
0 k) Q% n' N% l4 d# W7 [  发送count指定的Echo数据包数。
6 h7 y8 \0 D- |- O8 h0 ]  
* @% i+ u8 u, x, y( ~0 M% L  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: : N7 ~. g* P. r4 n% _/ w% ]4 R
  
9 {& y4 F& C; M, B% d  C:\>ping -n 50 202.103.96.68 % {0 \( F  V! Q; q6 [2 {
   7 b# _, Z. G! `! q1 ?
  Pinging 202.103.96.68 with 32 bytes of data: 0 h  [  G5 F! h  e4 M& l
   ' H# j7 d7 ~8 t  ~0 Q, b% M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # j, |0 R  X! A# O# \1 {
  
5 o$ `1 x4 v( Z6 J2 `  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & t+ V( |5 j4 a) d! X7 r
   . E# B, y+ j3 u$ I# ?: {& K- D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 e8 H7 S3 A0 x+ M/ P  
/ B2 k. p( F9 s/ Q  ]  Request timed out. 2 v. D$ O7 A6 i
  
) `6 x( y# _' e1 v0 J  i  ………………
+ `3 k( o. m# @; n' ^   4 Y" c: F4 ?9 I3 a0 q9 {
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( V# N0 u; @( p( L! D
   5 g! P2 A' z2 b$ {0 X6 k- h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) e! I8 d  f1 Z6 h* j     @& b8 |- X; H6 ?/ H/ x9 C* l
  Ping statistics for 202.103.96.68: 1 C; Z" X  _: i  V5 G
  
+ k5 I3 ]; l( V9 N  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
/ |1 x. r( b0 J: o; E, P, n% {9 f  
+ }6 D' k3 N; Z& N& _* L( x  Minimum = 40ms, Maximum = 51ms, Average = 46ms
* K9 b, p* a) n  
% t3 e% }$ B/ j& J+ l  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
( }. E0 O# l3 R( c! E( d( F  
9 q- P8 s' B) v5 s9 g  -l size Send buffer size.
, H! h! ?' F8 ]9 H% n, S! Q  
$ ]% K+ `7 L9 i4 N. X4 e! J( W  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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