返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ) \1 v5 ^3 N7 H& Y
   7 [6 x0 q0 D8 }) U# S- ^
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
8 y" R; A! Z3 Z4 Z/ Y# U; z   8 K" y6 \8 F  o& @
  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 4 ?5 a& C& s3 x+ P, c
  
- I" Q: }9 \/ v1 W2 W  Options: $ F7 b$ A3 }: Q* Y! e1 E, W" d9 o) r& `
  
; }7 N" o6 U1 e1 w: D$ x* G$ c  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 6 T- G  R8 f1 M0 k5 T0 O
   - G; M4 h! Z2 [- W$ O, `
  不停的ping地方主机,直到你按下Control-C。
  p1 i2 v6 j* z- `  
* D# D) T+ R2 l" R  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 , ~) H8 X; D4 o* ]$ V8 z/ I: N
     d* F) ^* a2 k1 Q
  -a Resolve addresses to hostnames. 4 `! B+ s+ ~% s5 G* e" N( T
  
: v* y+ w) h: @  解析计算机NetBios名。 / _" j& }5 b! k/ p( t
  
( x6 j! K6 F" e2 [* B3 v2 G! G  示例:C:\>ping -a 192.168.1.21
5 Q9 Y: \+ m- v# L1 f) Y6 b4 b   6 Y+ F* ^! Z8 I- t
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 5 T) A' V3 H6 _; s
   ) M0 N6 f+ v7 m8 C9 c$ E0 ]5 R
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; K7 x6 I# {( R% R/ X& H  
6 W* H5 e( ]% K& k" c2 M0 }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 Q8 I) \" u( q1 J   # _( w# }% _1 n7 ]  l; N' `$ a
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! W- Q9 a- {$ t/ }; E2 T

4 L& V0 x9 N7 \  m& {1 m: V  
0 j: n6 y2 v: [6 Y* q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ X2 d1 t1 t3 T4 Y# s
   6 R7 y: B& {, W" J4 P) a& w7 P
  Ping statistics for 192.168.1.21:
1 X. v1 C; l& h: y: y  
5 d+ V6 M" E+ r/ ]; A. z  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 7 c" ]1 ]( m( E+ x/ [9 O
  
4 S2 `: v, R# U9 F$ R! b5 |- w  Minimum = 0ms, Maximum = 0ms, Average = 0ms
6 J% v. |/ Y, w" H1 ~   5 x2 K) X) V' [. n: A; ]
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 . D8 o! ~& Z6 J( c
   & F% V$ k; l! C) L, ?9 F' L
  -n count Number of echo requests to send.
6 d$ V( o, H# Z: z$ P) z' [$ i  
+ H; Q9 s6 \5 B8 L: |# e* y  发送count指定的Echo数据包数。 0 F9 u# l/ w4 F: L' j* t9 z
  
6 [- n9 ]( q1 ?  i% I  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 8 \6 k8 V6 ]7 k! ~
   & p' l/ {/ B* T) x7 ?8 s! c4 s
  C:\>ping -n 50 202.103.96.68 ' x- X5 a$ A' x. [5 u
  
( h2 X. ]4 ^0 X5 x! ~* Z; h  Pinging 202.103.96.68 with 32 bytes of data: ! W/ M3 O! b' [8 I
   * j+ G7 e7 B  u" D' |, H# Z1 j
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& X+ \, i9 |1 `9 s9 R   " `% I- i5 \# y% q& k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# w8 t' V# n8 ?9 D  
5 G2 `( e9 Q6 |6 ?  ?- s  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! h, A6 x) j& R' a( h' U4 i) y
  
3 B, j  W/ w1 x  Request timed out.
9 L4 r: W: k5 W& }) b  
( a. m5 j! {& e. T$ D  ………………
# L' N& s& V1 p2 s8 _  
8 D) Q3 ?2 n: \  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  G, z; S! F, l* l   0 o# E. K- n' s# e+ r, n
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 I) ~8 e! b( s# ]! a5 h   ! G* p) F1 n$ X, |: q
  Ping statistics for 202.103.96.68: 0 [) K0 X& g$ u
  
4 M9 S6 o3 K: n$ [$ R# c# g  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
  i8 w" t4 t5 I& {! b  
  e3 B5 b1 q0 u  W' D  Minimum = 40ms, Maximum = 51ms, Average = 46ms ! o! Y7 P( g8 d# U9 P. _+ V- F* \  M
   4 I: V& k% b& S3 \5 d/ q
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
8 M* Q2 \& d" B% i( M   2 U9 A& A/ ~1 Q  q7 Z
  -l size Send buffer size.
* G4 i7 J/ @( w2 \/ i: y  
4 m" ?0 s5 J3 n0 J2 ?9 s; W  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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