返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
5 R+ E; U+ ^& a# `3 @; n   2 r2 n7 f; U6 u
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
/ `3 [+ E# m( {8 n7 Q6 j9 U8 `" ]! p* t  
3 C) ]. I  \! {" a; m$ ?  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
! p* |3 M- _, S" s   9 S0 D9 d- @# W3 x
  Options: 0 `/ M% j6 L. ^7 v3 Z
  
- {" o' l0 C1 f4 N  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. % Y% |" I$ p' r. D
  
% W' G7 M  m/ V2 D( P% @( T  不停的ping地方主机,直到你按下Control-C。
; R+ W* u; g2 J9 a- Q5 w+ l  
" s+ V6 ~, [) L; U, H& \# i  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
4 v; y& d2 O' B4 B   ' _, C" Y+ ~. M  R, ~# a# N  F
  -a Resolve addresses to hostnames.
6 z1 K5 i" X4 K  
& f8 \+ P5 i6 P1 B# n  解析计算机NetBios名。 $ n! Q. o, Y$ `9 ~
   1 z! R; W1 t7 k/ Z* J
  示例:C:\>ping -a 192.168.1.21
9 Z% n9 w$ U! f: t7 G6 X" {9 s7 H   + N' Y3 x: N9 h1 \+ [+ U, F
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( ^9 R- l+ i4 P. w. X* G9 u
   ) _+ r, \5 n4 W& S" ?
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; n! e, ]7 x  N" i! x" y! k7 ~# T
  
+ i2 r6 t9 n7 w7 ^  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & z  I" ~9 n) \' Q
   . @: }. M& R9 k$ m0 h( H& Y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; Q' a9 F+ f* c/ Z& ?! b6 y0 h' x/ I/ \
  
0 F2 _0 [4 w' X$ O+ w  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 y) T) D% W' b# s. u( L& _, r
  
& z9 X& l, G/ j- U8 A* S4 R7 s  Ping statistics for 192.168.1.21:
5 D4 A! a: C( t3 D# K9 H9 A+ p  
+ f, d; }- v. C  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: $ L7 C4 ~/ w9 C
  
# Q3 M5 V2 J, s' u  W  Minimum = 0ms, Maximum = 0ms, Average = 0ms % C# H& j  S3 I
  
  u9 L0 O5 ^; l' k/ o" B  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 * n' _! c+ b& R2 F, E* I! u6 U
  
- n  M0 p1 A* N5 R; p. K# p  -n count Number of echo requests to send.
3 L. n2 e& K9 W! Q0 T% v   1 }' Q4 _: r8 X8 _
  发送count指定的Echo数据包数。
- ]/ F% U0 v' X0 h* @  
" U. H( u/ @3 k% `  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
7 j" }6 m) o: U$ f3 A' j  
# s$ S, Z5 v$ K7 {9 f  C:\>ping -n 50 202.103.96.68 ' @) {2 b( x) \+ m  {& V) Z% r
   6 F' I2 {: C7 g6 J: b
  Pinging 202.103.96.68 with 32 bytes of data: 4 I* p0 d. f5 v; m
  
! Y9 g+ s# c2 E, z/ S9 b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . J& Y3 Q* {( |# j: R
  
6 w8 i$ p' m! s+ D. \5 ^  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# q7 e; }5 ~# h) w  P: S* P   $ m( W' D1 p+ W1 [8 I% R
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 G) _( w6 R5 b* z   7 q$ s8 g! O. [
  Request timed out. 0 E6 u; `8 s  E% a. E# O
   * r* P# N" F2 c' Q& x
  ……………… 7 c6 n0 j: ~; g+ ]0 q
  
, `4 z7 S" H. j) \+ g$ G' y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # D& i. T8 v( B/ l; r6 J
  
4 ]) E0 L+ a" G  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % ?9 _+ U2 |) F; _( {
  
; _$ d$ ]/ u% N6 k  Ping statistics for 202.103.96.68: 7 B+ g, `+ D2 r" H5 z( ?
  
; b( q: n+ N5 y$ Z: y; p  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
: @/ W% Q5 p' P: J9 W; H# X  
& B3 \4 D( I0 a/ V+ N3 K6 n  Minimum = 40ms, Maximum = 51ms, Average = 46ms 4 b% q0 I; ^+ a% @; }
  
" b! N* B6 t7 e2 y  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % L) C+ _  `' X5 M! Q
   + Q! ^: O+ ?' P* P! B+ B
  -l size Send buffer size. . [) @  p) {" A; ]7 G; A
  
9 S* u+ M( f7 ?, w  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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