获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
9 k) v) o) ?6 u; X  
: ~, X; u  b5 ^$ c* f$ U  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 1 V4 U; X  ]: r  ?1 @
   # |1 X1 m8 u! r+ ]; I$ w! b$ e
  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
2 j' s' d8 \! q0 |- Y   . W9 W6 b0 \( z7 I8 o
  Options:
; E3 f) @8 y: a9 x/ p2 b* r  
: O. `/ J* a: T* ^9 l1 E1 p+ c$ M  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 0 C6 M' I& U) i% d7 I- V* h
   ' p$ A& a+ A1 j2 V
  不停的ping地方主机,直到你按下Control-C。 8 l+ P( Y% {( i5 o+ I5 H+ v' v
  
4 w8 Z! x2 l0 X# [  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
; ~- f# T: x8 c   4 `6 e4 Z& d  y! e0 L3 y& F; g+ y
  -a Resolve addresses to hostnames.
! V" N; s( i( P! {0 S. o     L4 }5 Q$ B. g! @
  解析计算机NetBios名。
9 l1 Z4 ~% [5 g8 E8 {+ E  y   3 n1 Y, g; I. i% r3 [
  示例:C:\>ping -a 192.168.1.21 # D; N* f/ s3 p  P% i2 q
  
( \+ Q# G5 v9 V& J* R  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( B- r9 c/ b+ W
  
. n8 ~7 m& i; F. e& w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 u/ f) o1 p0 G3 k   7 }4 J: U) n7 }5 o7 a
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! ?+ {6 e0 K1 ]/ J5 Q
  
9 C/ N2 e2 }' b# X: D8 w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' t4 ]7 g6 H2 F& A+ M% i* p" [2 d: b
' `- \' d( F" {8 b   8 |# ]% `) H: H) m/ y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . d& V6 M3 a* x# N
   ( e9 q' ]; |/ C' o( U& A
  Ping statistics for 192.168.1.21: $ l  K3 e: v, Z4 ?
  
% M9 v, }8 Q+ j4 {  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: . H+ ]5 g# b4 Q1 c; |+ K8 [
  
% [0 k1 h. \/ D) t  Minimum = 0ms, Maximum = 0ms, Average = 0ms
: E6 ]( E7 a& C# w8 o, S6 a. n  
9 a# R! `* p$ n7 N4 ?7 A4 d/ t8 A  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 - V4 H/ @3 {6 H, c9 Z
  
) _+ d4 S8 Y9 `  -n count Number of echo requests to send.
8 a+ z" |% s7 k  H6 K2 v$ u, l" S5 Q  
1 {9 B3 \7 y" f: N: b  发送count指定的Echo数据包数。
. L8 ~9 K% k- R; Z) P   7 f' b/ v6 |7 a% O. s
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:   f, K! c  W  w( Q$ V8 M
   * z( l" p, C2 O! l1 v: a
  C:\>ping -n 50 202.103.96.68
2 U! [( h( C1 I! ^. o; T- c   3 ?, h- P2 l2 z
  Pinging 202.103.96.68 with 32 bytes of data: ; O5 E& a8 B' k3 \* W2 H7 J  v
     U6 `% o0 n& I, i& n" E
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ I7 _$ @# H3 |8 v% `- C9 g4 P5 t  
1 Z4 g( A! B- P- b$ F, l  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , i) {3 ^: c2 A; E8 `+ I. u: e) R
     |* ^2 `% F0 j$ s
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  n2 U. }1 y! _+ h/ E  
% T1 v. A. p+ S1 a( I  Request timed out. + O9 h+ B. E$ r" w" f7 b& ?, d+ v
   3 r" Q0 D4 a; |+ G4 M1 K/ t
  ……………… 5 {% H. n' ]. e
  
5 y9 q6 W- O. u8 F' E; _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 r! v/ J  j7 r# ^9 l
   $ u& E; t: G; Y( I$ j
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : r! G7 i1 O, G$ }
   # P& Z8 c0 k) ]
  Ping statistics for 202.103.96.68: ' Q" G6 M! {& d
  
/ b  Q7 E3 E9 O# y: ~  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
! P$ j& W9 a* a   7 x; j( J% v" a6 X0 Y$ j$ K
  Minimum = 40ms, Maximum = 51ms, Average = 46ms   q% ]( g& z1 E, D1 q+ v0 ^( G
   5 w) t1 n3 |8 z. ?+ U
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 9 f5 X" s1 j; ?, O+ i% s. E4 h4 w
   , W$ ~' _1 p: v+ r
  -l size Send buffer size. 5 G  S4 S! S% R/ Z6 A! ]
   " x! ^7 |, Y* z8 h% G0 r5 Y8 |
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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