返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 / v2 Y6 |: n7 W) W: r4 S
   6 ^. y: U6 L7 r. K
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
2 b0 u) G, @: h( R3 h' u   ! s# Q" {" j3 ?
  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
, b$ t0 i5 n6 v3 p, y6 u% @   1 g* |; v% `* Q8 C+ ]6 P
  Options:
9 Q* w( b8 p( E. j. \7 n4 \   8 c0 G2 ~+ A% f, ~  c- B
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
6 W: F$ B3 ?2 ^  
4 f4 L/ k3 |* o. d  I# ~  不停的ping地方主机,直到你按下Control-C。
0 a% z( v5 t5 Z& O9 `' x3 r' i/ U   & N# C0 H, V6 _/ S4 x, @
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
3 |- M) Y  C+ ?; M   0 y0 F( m' I" W  z8 t
  -a Resolve addresses to hostnames.
# H+ x0 o, O& p   . z3 D  d' Y1 r  E9 N6 `, I
  解析计算机NetBios名。
# z0 p3 Y& g5 [& a1 K. m0 D   / f/ F" V, b% z6 u5 `
  示例:C:\>ping -a 192.168.1.21 / \6 h0 @) G6 ^0 Z
  
1 c) j" O4 |/ U- G5 i/ R& j% x' Q# v  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
9 `+ e1 r3 e* U4 W) R; \" z  
' e# n, [  G) V  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 B5 ^; F7 P/ N/ `2 e     z% W# b1 O8 k% c4 }( Y8 c" o
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) i1 Z0 T# H4 d0 t0 F
   9 p' l. I: }# Z' @+ T# k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- V6 l- g( K  }, n" B1 F9 d
! |' n: S: J! r: G  
" ?: g+ F+ _/ u1 p- s  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . V* G1 y; C: ^
   % n  h1 e. ^- w, c& O# M
  Ping statistics for 192.168.1.21:
6 z6 u" H5 R  Y3 U1 Q3 Y. b  
3 Z& S5 j8 c: O# \, R+ M7 o  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
* L' S% d5 E' ^6 t  
- G) P0 G, j. o% g# M9 J: M  Minimum = 0ms, Maximum = 0ms, Average = 0ms - @0 ~+ o, ^% d. S6 ~
  
, j6 E) Q. _7 G3 I  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
. |+ ~) u' n' Y) c9 h3 w8 B  
% Z1 k$ a2 _, L9 ~  -n count Number of echo requests to send.
$ j3 p5 u6 b  @5 s# R6 x  
' Q* X9 n0 }, J( ^2 J1 _. ?; C& a9 J  发送count指定的Echo数据包数。
. b, d* q$ J6 N" Q: b$ O  
3 G4 t* v8 C1 z3 |! k. Y* @. V  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
& [, o* Q/ e' t+ Y* N# P  
1 C% s7 m0 b$ {+ _  C:\>ping -n 50 202.103.96.68
" Y( g" W' b  I* o9 b% `   . ^7 w* g" b- q9 t
  Pinging 202.103.96.68 with 32 bytes of data: ' ~' m" Y/ m9 R2 V
  
. v' s. o" C" i9 [- p! U  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" B$ x* D: E# _* o+ T. Z   % ?( X1 l: H$ W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , f' j* e7 C. M" ^
   + N4 u! [9 w5 ~9 z/ m9 u5 `! m
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 Q9 I' o. s. T: H
  
4 @4 q" b$ u: h  Request timed out. 5 h% G: f4 \8 M0 F* o. r& ^' x% R
   7 P- B. n* ?5 ?- R3 p
  ………………
/ j7 e+ m0 ?, O: h* E7 i   + ?; c) j. }6 w: B# `: [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. m/ p5 m6 X& a& T3 s   % B0 G6 w9 F$ L  [: |8 D# B; {
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 a' |4 Z% A" d' f4 _2 X- h
  
8 T6 t, x. s9 D- w  Ping statistics for 202.103.96.68: 6 j0 ~3 K  q$ w! t, V: @, A
  
: t  ~5 u8 H& t4 n0 H# s4 T  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ( a- _/ z: c9 X4 m2 B
  
( L$ S& Z4 Y4 f* L  Minimum = 40ms, Maximum = 51ms, Average = 46ms
7 Z! w: c! s2 S     |# Z' s; h2 W
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
; n. e0 g! X+ I1 O0 b  
6 {0 o2 g- G3 Q: G, y$ k6 v& E  -l size Send buffer size.
% K& l1 _0 X& x8 w" E* H- j! y  
6 U/ t( A! |: U/ [; Z5 S" S+ B  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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