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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
  x/ Q: |" @* |4 o   & L' N9 U* m4 L
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: : X' G7 q4 E# ]8 N% I- [
  
& ~& h! G# y& \' b  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
% ]' @/ l3 v8 w+ `% O   - I* C3 K' A3 i7 q
  Options: ( a: B$ {$ k+ Z% t1 a5 G3 p
   . @" W1 Z" V; `% [8 E9 l
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 6 O* ~& S9 Y/ P1 V2 o+ @( O; S1 E
  
* p& n/ @0 m: p- U  不停的ping地方主机,直到你按下Control-C。
" R9 x) J! @( F1 L2 |) K  
7 J( E- O8 R% @: v& a' a4 i  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 . q1 H. U! u% {
  
8 v- I0 n3 w7 _4 R* H. R2 o  -a Resolve addresses to hostnames. 3 s' z. d" [" \, G7 t
   $ Q. I0 G! {9 i% v
  解析计算机NetBios名。 6 c+ j1 J5 ?0 o! ]" ?/ _% k
  
. B$ E" p8 A) \$ ^4 H; R' t  示例:C:\>ping -a 192.168.1.21
+ j5 T+ _$ s- f* u" F# F, Y- C: ~   * R7 d2 m& W. A$ N% g0 I6 j
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
6 r/ c, R2 J4 g' g  
, }' m) v" v# H- I8 I0 z, }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 E5 d' o3 |; m
   + v' z+ E% T8 y. i
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 f* k) U% R2 c5 r7 [  
8 \7 m. B% @" S1 a- ?  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& G2 U) S/ A' D+ ]. H7 Z0 I
% }5 L3 I, z% g$ n   * z) J) P1 C1 M( n6 A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 s: n$ o/ {  N  
0 h( a! h  u0 @) _$ F  n; E  Ping statistics for 192.168.1.21:
' S; C+ T# a* u7 [" W  k   % i" v* R5 }( w/ K. K1 M
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:   l4 E' G" T4 H; [4 i' U1 a+ P- B
  
4 j3 U2 j, `; W( c' e% O, G  Minimum = 0ms, Maximum = 0ms, Average = 0ms 6 P$ j: s9 J" D* e: t
  
6 [1 f0 Q" `1 F% c5 ^  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
1 y* r3 Y) P9 V( P  
0 Z! p" b. J/ C7 N$ ?  -n count Number of echo requests to send. 9 o* T/ p& v; @4 y( U
  
' b. c4 j- B/ @  发送count指定的Echo数据包数。
$ ^; N* o9 {+ j0 r5 B: M     `0 n" Q! h9 a
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: # l* H, {! {( j+ y9 J& w, g; ^% S' b5 Y$ }8 `
   # ?5 d* ^  l. a
  C:\>ping -n 50 202.103.96.68 ' @# [% @1 V7 l) @! }
   , n  ~) ?2 }. E( _- p0 k+ a
  Pinging 202.103.96.68 with 32 bytes of data:
& ]% ^5 |0 C) w' @: w  
/ c4 @0 l# ]+ L" l, F  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! T' e9 A% h/ g   ' j( q5 @" S" ^0 z" _
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % I5 J# _8 h% Z9 R. o1 n
  
, X; n3 _# b; H  e7 W. B8 u  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " L* m: A' T+ a; b
  
, Q1 @) U1 F- P/ A. `& u/ s7 d  Request timed out. " X- H3 P) }. T# p* n7 Q
   3 L5 }4 d, C4 a
  ………………
( \0 w7 S6 c- h7 g4 g  
/ x' F3 k# ^3 I* f+ k; j6 H  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  K3 L2 V6 o% d* e: @   9 y+ n0 _6 |1 A( P  o) R$ ^4 @
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; |! O: W* |0 v: K; W. Q9 l0 f: X
   % o! j% ]1 N( q& i  R, \! P
  Ping statistics for 202.103.96.68: " c+ g$ w0 j' E7 A1 ?
  
3 r5 v. O2 d# \$ B0 x  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
. z) P9 `, A. ^; I$ M   . ~! d( p% l; f
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
$ [' \) o8 M; h/ S: p( p   ; @1 V! \0 ]# ^% G9 I% U0 M* _
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- X) P. O4 G" B1 v( d1 I2 V  
* H' q2 D& T! e: [' y9 ]  -l size Send buffer size. 3 o3 k: `# ~8 a, H
   9 K+ F# A5 T) d- v0 ~
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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