返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
" L/ {# e  m4 _2 o# F   / x. J, b2 z4 P) d- k7 O
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
$ }( r$ p9 l7 R   8 H' r, Q. @* P# i
  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 H! k* X% t2 }! r5 }, ^8 Q/ d1 _/ x     ]7 A/ w; H+ t! l- b' w
  Options: 1 e& t& ^. ]% t( @
   , m& \% {- h8 h& w6 [
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( Y0 O, T' ]% ?0 T6 O$ E4 Q
  
- t& u8 q, f) F' r7 t/ K$ R  不停的ping地方主机,直到你按下Control-C。 : w# ^5 U! h; c) b8 K' q  v; ~; V, O
  
0 q8 W1 j6 s" l; K! [0 Y  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
# D$ U. X. o0 Q" \) @   , ~9 n: D* O3 `! p
  -a Resolve addresses to hostnames.
2 H% C; ~+ |% ?- @  
- Z5 @( `+ M9 e, Y7 Z$ s  解析计算机NetBios名。 + f' D8 b' n! b, m7 C
  
1 u3 i7 C( R# f5 S2 _  Q' X  示例:C:\>ping -a 192.168.1.21 1 q3 L) I" r3 ]; g
  
* H* d8 ]9 D) i7 F: z  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 0 X- V! I$ J* b8 i5 z' ^
   6 x- y* k4 c9 a( x/ L+ k9 {
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # `7 x+ W: {2 c7 ^" f* l
  
- q+ w5 K9 Y3 x+ x  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" c% `  X! P6 b& z  
( ~- q2 m5 m* b+ [- P0 X. E8 q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   G$ j5 r; w  B$ c9 I0 v( m3 V4 t

% ^8 z2 R5 s4 d5 q, }   6 c6 A6 w* f  i" _. q+ o& ^
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. l+ [( P, u) j+ {  
# ^" P! `4 G2 ~9 ?3 |' B  Ping statistics for 192.168.1.21: 5 x7 B  j2 L* T; T! g$ C; e  a1 q
   " l: P! B' m- G; N
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
  Z% c/ `! C4 P* `( Q8 _1 @7 l  
9 l0 f8 l" @5 V5 F  Minimum = 0ms, Maximum = 0ms, Average = 0ms
; `. h4 p; p2 @! k0 m5 L  
! F' r) D+ Z- a; d  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 9 h8 b! f8 h) _2 C5 D9 F+ A5 `, D
  
  i3 S+ L9 q( W  U  -n count Number of echo requests to send. ' J7 y! I4 K+ h; U
   , I1 L' D2 C0 q- I, y2 t
  发送count指定的Echo数据包数。
9 a+ u/ n* d8 v1 V1 A+ C  
- X% @& z# F2 v$ E' U& J4 A. }  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
: g! W1 u0 E7 o; {% V   0 P& ^6 P  a+ N, f* V6 o; _) _9 a
  C:\>ping -n 50 202.103.96.68
1 [+ G4 N0 ~$ W" M. O+ x6 c* Z   " Z( r. Z. r# X; J4 h  h, s
  Pinging 202.103.96.68 with 32 bytes of data:
/ A  k2 c' `" P2 N   ! u$ e9 ~: d3 o- H0 M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . F5 U" B; Q+ s. o) E1 n& w4 d
   5 [* w+ }" r& e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 m% f# l' K; `) r  
2 y5 _. `/ i  `4 T1 S5 ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " c2 k, p: P2 ^
  
# |  A" O1 J: }1 V  Request timed out. % \  I2 M  c9 X) L$ _
   ; I! [5 L7 Q2 k7 p
  ……………… ; V# f5 X+ S8 E2 O0 d
   7 S7 K6 n7 `" _* {& g3 E; e
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! W1 Z( s' X  v4 e
   9 E6 }1 J0 ]  g! t0 c9 f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) o/ E3 I! }. y8 g3 p$ m
  
' I8 o2 U  |) X6 ~# x2 l( ~6 ?: h  Ping statistics for 202.103.96.68: 7 b% A$ P$ `5 `9 y2 J# Y
  
# |" x) I" h! B2 x4 b  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
! P0 M$ D5 l8 J$ k3 S4 @   * k) o+ q1 W0 ~6 ]. R# W/ S5 r
  Minimum = 40ms, Maximum = 51ms, Average = 46ms ' I: s/ P% L6 O/ Z4 M' g, l% O: O
  
; y( x; ?: y5 i  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
' F" f5 E/ i3 ]1 _4 Y5 A   0 P1 B: h) S( {0 r
  -l size Send buffer size.
5 |& X" i1 y% u$ H6 d! \$ q: X! Z  
0 ^: o  g5 n; C9 \  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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