返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
) {- R4 W# K  w' ^8 B- l" w  f  
( m8 |: g0 J9 Z# W2 w% Z- c3 \0 \- X% I7 n  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: . _1 z$ _  q. g4 {* d) t
  
0 m1 F; P  m* ~, Q. G  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
" x! W! d9 {; Y0 {" p# F1 \1 G   2 |$ j8 D- e. _" I( {1 L
  Options:
! T- q# s1 ^# C- L7 N1 a  
- \# R/ w( {- X3 i1 J8 M# x- x  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 4 p# M1 t* k8 m) b5 L1 Z5 {
   6 \; c1 ?8 e! ]0 p- \' _
  不停的ping地方主机,直到你按下Control-C。 , e( G* n* k$ h
   5 d1 x) T( d6 \. }
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
) [# M, j( @) g) Z  
5 j1 @/ H! k3 s3 L) d- q/ |7 \) i, |+ H  -a Resolve addresses to hostnames. : _; ^- }# |3 ^' I+ N
   0 T0 h6 h  j# S' R1 m, L
  解析计算机NetBios名。 * v& S3 a6 V+ k$ g6 Z
   : o. Q  `, L( R) Z/ Y$ _/ B
  示例:C:\>ping -a 192.168.1.21
8 @4 _7 E7 l+ }% w$ V/ ^* a& _  
! B6 X: @  u) N/ @6 S% S  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
4 a! P) _4 u( c. ]* ^# s& i  
* s+ L- V0 e' x2 K. \( _  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * L8 W7 c& b) }8 L$ h
   + M5 ?  z7 ^  E. N
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ R5 T, I# T# o/ j+ f% K6 \  
7 x! r( |" S) _. h  \0 `1 v  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: w4 o# z1 C4 Z* j& ~/ t' Q
+ d" }' s, Z1 D; y3 ~   . L# l, N& ^/ ]% r, J4 k- C
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 Y1 Y( U  Q0 ?& Y' F9 y" }
   1 q# O* \( e( e9 B- }: j/ o6 [
  Ping statistics for 192.168.1.21:
! X/ N! l8 p3 {' U" S+ ?  
" X* C" K8 V( u: W  V4 n$ [( f  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ' E- i" ~7 ^3 u  ?! a- i; G
   0 ^1 W1 }' J: S/ q
  Minimum = 0ms, Maximum = 0ms, Average = 0ms . G6 K: |4 R" U+ V- p
   " c' V6 _! x- o  u$ Z( J! p
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 & e$ N9 v1 i# B* D6 n4 z
   9 [* C4 k& j9 i& _+ H. f# `
  -n count Number of echo requests to send.
: i3 L! l2 t7 D! Q: W) B( U  
$ f! [7 R6 p2 {5 N  发送count指定的Echo数据包数。 $ K# f6 z* n: n; V  L
  
% b: A1 t7 ^9 Y, S5 ?  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 6 g" `1 r/ L1 {2 Q0 I
   ( n$ Q) k$ }; {$ Z% P$ F. M! U
  C:\>ping -n 50 202.103.96.68 - U# P7 [' w* i2 A
  
! _  _: h% y/ ?+ Z* B8 E) f  Pinging 202.103.96.68 with 32 bytes of data: 6 R9 A+ H7 c8 k0 d2 b- c+ E
   . g/ c0 X3 I, d& r
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ ~8 r, |$ ~# s" M$ t# w6 e4 [' _     Z- `" i" ^& c: Q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 {* N8 m: P9 p! W/ m- a   " G: q6 ^  Y' H# k  p0 k* B, g2 r
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; K1 O& i" j1 R9 N3 B3 O
  
5 V: K! T. G1 y' H  Request timed out.
5 f1 ?, Y/ @6 @" X* P: t   * P/ X* e, W# H" ~7 i
  ………………
) A, a. |  V2 U0 u! i  
8 Q9 f9 k) j! E0 z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 ]* e4 K+ I6 S6 ~" T4 ]   : h/ o) J" B) M/ f) }5 b+ x3 h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: g6 {, S& J$ U  
6 b+ E2 d; c+ p$ ^8 j4 e  Ping statistics for 202.103.96.68: ' H# Q# c: z; A4 c0 D( l
   . Z3 e- e+ S& j6 ^7 [6 Y- ~
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: $ H" C1 Z; g' h/ S; `
   # S2 e5 S( V- |: p
  Minimum = 40ms, Maximum = 51ms, Average = 46ms . d5 ~8 w+ \3 D9 y2 @5 L6 q
   ' L" q/ B7 p$ ~9 w4 Z$ I/ J4 W6 a
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
$ ?0 c1 Z  I7 {  
/ z3 I5 r. o: ^' i  -l size Send buffer size.
8 p4 N! ?) E( f8 M   ) J+ D9 R+ F, Y5 D
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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