返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 0 R1 L4 m7 @" D, g5 M
   * ?5 h0 @* n# O3 M
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
0 _7 p5 t+ M9 S( J* i  x( S& M  
- |. [2 t0 s; b+ K( l" l  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 + V" s% o; Q7 m
  
, a4 r5 [* e. w8 f  Options:
# Y9 z/ v* [7 O' q- y  
, _2 u% f9 A' P! k* _+ g/ l  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
5 `# n% B0 k) J9 }- l$ w  
0 R% a, ]5 O6 F+ v* {. U  不停的ping地方主机,直到你按下Control-C。
  I7 c# R( g& j! W: \   9 Y6 i4 f- \  P5 G
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ( i7 L% H& e" Z# y. {6 I
  
6 ]# ]5 l$ i: x3 E9 Q- t  -a Resolve addresses to hostnames. % H2 ~& ]  S; m
   , C6 m7 W+ j! n5 K- A. R8 }2 g4 H
  解析计算机NetBios名。 2 \6 O  w$ N* `0 p
   % D! W9 h/ i$ Q* l# v2 O' B
  示例:C:\>ping -a 192.168.1.21
' R9 h2 m1 L! f) O2 p   6 s: T, t% E; C3 k2 z$ ]& ~' d7 |
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: : {0 J: E! H$ x' ~$ ^3 f" p; i2 n
  
* p2 W4 g8 l5 A  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! J, E- S8 T' ~$ H1 b
  
1 V3 B0 Y! `; G. s1 i, ~9 Z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 B) g, Q3 Q& p7 c5 ?+ z  
4 g! C/ {+ i% q- E* }5 Q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   F% p! m, V  e4 e, H

$ n9 Y* w! P. d! f# ~$ D" e. P  
) Q7 W9 e! d3 O$ `# c, N0 \  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 X3 k8 W. X2 u# ^$ k% l0 R     U, s9 Z' c( C% W5 F/ S. }
  Ping statistics for 192.168.1.21: - H" ?( G. Z( F/ r, ~7 h1 n! w9 q
   " I) U! j8 e) Q% C% \2 F$ Z
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 8 p; k# C" m8 j8 J& c
  
# h9 \5 `: C4 c6 b6 G- P* _; d7 n  Minimum = 0ms, Maximum = 0ms, Average = 0ms " e& I# ]* V( E9 M3 [4 g/ d& {8 ^
   - G9 e1 ?4 o9 n  a
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 8 O% C, i8 X4 x) N7 z* ^5 t) }
  
3 X4 O  U0 b7 {  s  -n count Number of echo requests to send. : Z: [/ M& c! F! ]. u6 b6 G. Y
  
9 |0 Z4 ^7 D6 c2 S( R4 V; Y  发送count指定的Echo数据包数。 4 Q  V, f- {( W4 f! _
  
; `  W" b: n" \- ?0 X  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
. A" P+ y+ N6 s# S$ ?) k   " s2 J6 ^0 n5 Q: X3 `
  C:\>ping -n 50 202.103.96.68
* f+ m3 Z4 R2 Y, J; D+ V  
$ ~( t$ V6 Z$ K7 A: L  Pinging 202.103.96.68 with 32 bytes of data: + O- x3 r  i  ~3 G* h
  
% k3 O2 a$ r; X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . Y7 b; s. T; d2 A1 @$ n
  
( S* [* l2 @3 t) O: R  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ n" f6 s1 w8 u  
) Z/ d" A9 }7 O9 J  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
. S- E/ t" U) l% F* B& T   ! K( C8 K- L8 i1 T3 v  Y* G3 Y2 W( O( U
  Request timed out.
; z! b' j3 F" C& G! h  
  C  z2 Y8 g* q' N  ……………… . w# _6 Z8 C6 p* V  z! H( l# }3 ]7 U, X
  
/ K2 j; G: C5 P5 R3 c/ }  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 P0 F1 |9 H1 Z. w& a
  
1 _. O. c# O2 }5 `  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 Z2 |& z  ^1 _4 s' J! i( h9 J% F
   ) n0 L+ Y# Q& @3 D, K& j
  Ping statistics for 202.103.96.68:
1 }5 ], ]* V' `0 `/ Q: b. D   ( E5 T5 m! ]1 E3 C
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: " O0 l" ?+ h* j4 A
   8 T& _" o( @* |0 L7 J& N3 S
  Minimum = 40ms, Maximum = 51ms, Average = 46ms # a, E6 O* \/ E7 I! h
  
1 A: B- j( j0 I5 G  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
7 i. G/ \  B: a( i5 a  
4 B5 H# H5 N# e  -l size Send buffer size.
$ b  k# k( x) `  
1 }: U# d# M# H7 \+ w  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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