返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
$ c5 W  E- ]) d' b4 F/ ?2 [$ \   ( v. E$ X# ]& e. ~0 s2 J
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
: \* R; }% m. Y- Y' F- H; j/ e   5 h( R) m" X. n1 g! p; d
  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 7 k/ A* j& \7 W! F, ~# o9 k
  
; m* V1 u& j; C1 k6 F  Options: 1 s' j7 V5 {: t, L
   ( h. W( V6 l0 {* Z- O: G
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
) R! p. e6 @: B6 {( R   ; K& C; [& k0 f/ D
  不停的ping地方主机,直到你按下Control-C。
: B' r% p: \. n6 N$ F# _9 \   ' e( ?# Q# O; k  L
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
; S" [& S! v0 X: m8 P! q: M   1 y) B  f, Q7 S8 m2 v8 j6 E
  -a Resolve addresses to hostnames.
0 w, H$ d% k3 V7 N- q  
& d" ~" m7 N# U  Q  解析计算机NetBios名。 ! C! ]! W& e, g7 y
   5 |% s8 s' c( R
  示例:C:\>ping -a 192.168.1.21
& Y& t0 `* W5 t  
6 o$ d3 Z. r9 g  J1 n9 _1 b! ^  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: . T, [0 {4 y9 L+ c$ d
  
, q2 T7 l6 I, S) _  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- V; c: u1 q& F- D8 \+ g  
! {# m6 z! u4 S7 M  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- H, U& i% |/ u( r. t$ N/ i   3 a( I+ i  \- X% j  V
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% H# o* s& m8 T( F
/ k& i# u( P5 t! Y6 h  
5 Z  H. H" X- u  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 t$ o/ S8 W4 D
  
+ |* L2 T4 o; K1 g* g7 ?& V6 i  Ping statistics for 192.168.1.21: 3 i( i, J: w) X
   2 l% n; E8 I! l- |0 @2 }
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
7 W  V* z2 a' v% S+ y  
" x7 W5 U  ?4 p- X# i7 [/ Z9 e  Minimum = 0ms, Maximum = 0ms, Average = 0ms 3 l! e" P/ y+ _/ M! e# ~- Y# [
  
9 g5 r/ C1 A  B) w6 {2 @7 M  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
6 l) w( h" o* h2 Q7 }# ^$ x  
% \( T* J8 c8 U2 I) y  -n count Number of echo requests to send.
7 ^- H" `! Y1 p6 G$ J# l   0 |) k* U8 S+ T# T, i
  发送count指定的Echo数据包数。 * \! V+ A' ~% s; q
   + N7 Y% W/ j+ f4 u2 L* b1 |' q
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 4 N0 \5 h: N/ [' b* [
  
* |% o7 S' H( e# ~% a3 L/ G  C:\>ping -n 50 202.103.96.68
9 o4 N- m- u9 @2 V  
: ^% L' A0 q& L& P  Pinging 202.103.96.68 with 32 bytes of data: + W$ G4 }1 a' E2 ^; [) v
  
" K( T; K! c! e) o  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 P% I" f2 j1 U   : a, Z9 h0 [! |+ Q9 i: Z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 Y0 c0 B5 m. W) y2 b, \5 I& @   ( C* Z$ b6 Q# c9 u: N. L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 U' z1 A, w  M6 M8 g0 d; r1 v9 ?   / s9 a" f( k8 v& i/ F) T  w+ l
  Request timed out.
1 {+ Q) [; E/ H, u9 \   $ _( P+ Z+ T" N5 a
  ………………
3 M' O  r3 ]* h  
! `) h' ], B/ y& g9 \) N- L# b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , L9 _2 }  W; s
   3 G+ a9 D5 p" o: N
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, \) z4 W, G. h( W1 C  
5 q& Y  T) o2 V, W! w; b, @9 L  Ping statistics for 202.103.96.68: ; [8 M# f. W1 ?3 p  v  B
   5 ^0 X8 G  b% A  Z7 ]8 _3 ]; ]
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
1 |2 l* p1 l8 y! ]+ i   - j2 t& u/ ?0 I, l- X+ }5 Q
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
% ^- s  o0 h! T* h0 g  |   : P8 k: D# C. Z. z9 N5 r& E
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
9 Q+ k; \- N: \+ D( O$ K2 r  
: y  c) M" e+ p6 e  -l size Send buffer size. ! s2 |7 s1 B" ?, p5 x
  
9 H( k% }7 m# I$ g6 i  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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