返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 8 L+ D+ H# O" R0 M5 W) W/ N" A
  
6 Z" c& H; u* Q. }  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
4 u" c" H* C) M- h" ?   . ?# l/ e) M- A8 F7 ]8 @8 U
  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 8 F3 a+ e+ k7 C3 A
   & e4 c+ s2 }. E! N. a, D0 j
  Options:
8 {. x3 }3 ~( a" Y  
  [6 S( X' J: C1 Y) i7 A& U0 Q  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. . L/ ^6 G2 Z% @& C' q) z
  
# x4 g7 F- ]4 ?7 E1 m  不停的ping地方主机,直到你按下Control-C。 / b# d& e3 j# o. J0 G3 f
     X3 X" ~% m; ~# P. p2 U
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 , T% j* [6 e- C, I
   * A" _7 j% U, f0 R
  -a Resolve addresses to hostnames. " M) I. U9 B1 j. v; m+ R; H
   / f' N# [* D6 E4 B
  解析计算机NetBios名。 1 l: V# ^. a% t4 X0 Q5 @# c1 y
  
8 b+ n. E( G/ y6 L; H, m  示例:C:\>ping -a 192.168.1.21
% |  X& q$ q  \3 _/ e. S   0 k. V6 Q& M% \
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 2 P( H  r! ~( n6 Z  d) y6 S6 t
  
* h+ B" I  x; b" `9 R# J* b* C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 ~( Q* u4 z) @5 v" v$ d     @4 K# C7 U8 J  f6 w
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; G1 W" `4 ]+ p7 s  F5 {5 {, J
  
$ i" ^: \& h/ m, D# b& i- V8 j$ w5 T  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# K4 l: r7 V( f( k) D4 K- S8 h8 k9 n
   . f, v: s9 e/ G6 Z  D
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 c5 \+ i6 i3 C/ L# B' b
  
. P% y8 p3 i- M( n: y% D  Ping statistics for 192.168.1.21: 2 A, Y7 s" s9 o7 w1 \+ a
     m- K% F* ?5 S$ u0 N& l' D+ K
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
+ @4 g% A4 K  Q8 H7 L   ! w% {) i* I3 `: R6 S: ^4 d
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
% h6 u! k! `9 w* A& W  
* w3 v4 m# n& F1 u6 w" |! d& f1 `  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
7 D+ v" Z( w' |7 q6 S1 Z+ ^2 k5 L9 H  
0 ?" V; w( K% n; a/ R/ O1 Y* _  -n count Number of echo requests to send. , c2 W$ {9 `* M6 T, j  @
  
! `3 O( ]: c6 \2 h1 c  发送count指定的Echo数据包数。 6 O* {2 g/ d9 I  X
  
2 m% Z7 J( j  C+ R7 |5 W( u4 |8 P5 _  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
/ I5 K8 _6 e7 `2 [  \   " a& k0 r' s3 }5 r: c0 C$ o
  C:\>ping -n 50 202.103.96.68
: S7 e* c% l9 B6 V. u   6 T# [4 E  A: {5 M% s) M7 g. m3 S
  Pinging 202.103.96.68 with 32 bytes of data:
; R: f1 d* B9 [, W8 J   : q( ]; c' c$ N1 ?4 z9 I1 p8 y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* W2 t! {, d7 U& J+ p5 H6 p$ W1 v   2 \: u# M6 S1 \6 C* n
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- D& T. x$ _) ?# L   ) x" x0 X) _3 |  }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 N; P/ V" P1 h1 B+ B  
/ k; `- x, o  L  Request timed out. 0 L) I$ d2 _2 ?: e; k+ z/ V+ F1 W
   ( r* \  N- i7 u# t
  ………………
  ]0 L5 l9 u' V7 `& J! e0 u" b% n7 [  
2 @: ]1 M7 W, J( L  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! t" h2 N  O: |: e   " M4 I) y; W* O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 H* G) v; E3 ~8 B5 L1 v+ Q% r0 V/ R
  
) w# q8 R% b; X+ S, l  Ping statistics for 202.103.96.68:
+ O' J; Y9 n8 u$ x! y   % K8 t- W3 w0 L2 X) M
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: & O- L( ?, k* \, J2 i  {5 N
   ( x! v& X; J, {
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 [" B' D0 S+ F/ t5 j& u
   / F5 V2 f& |, v4 R$ Z+ w6 O" {6 n+ e
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 $ g0 n8 Z3 g4 b& \2 N* N
  
) |/ z) c7 o# q/ R/ c* t  -l size Send buffer size.
3 n# L3 ?" ?4 v   ; Z+ T. L% v" T* Y5 f
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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