返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 0 W. u+ ?' n* g; C3 y0 s
  
: U9 I) [) H; d& Z) ?1 [4 G- g  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: # [1 U. @4 E3 [) B8 p) e
   : X% P' C- R/ ?. P7 s
  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! `, i; |9 I, C8 Z0 @
  
- [. C1 I9 i% k2 L0 |9 g/ ~* [5 T  Options: . H6 E6 r, J6 D# `# U) W
  
! @7 d) @9 \5 ~& A- G+ `  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. # k* j- y, t# R2 V% K+ Y) B) \
   ! n: v. p* C7 }- U3 l9 H8 w& R$ c* r
  不停的ping地方主机,直到你按下Control-C。 5 E& t. ]( B3 u% O! E% t. R
   6 n( P2 c7 y; s* K8 [
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * @1 {0 \+ u" s) O% P+ R
  
) p0 V- @+ M7 ]/ x3 g3 z  -a Resolve addresses to hostnames. 5 F8 E+ {1 O! C7 w& l0 o& N8 l1 l# k
  
( [4 ]9 |+ g# z( w3 w  解析计算机NetBios名。
& Y2 x; f, G$ a- ]$ a7 R   ; t& I& O. p5 H8 |( z
  示例:C:\>ping -a 192.168.1.21
8 J* m% f0 v" l* ?) n6 \3 V   1 W% L$ e' O- g' i2 A
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 0 a2 h: A, I" V' l1 h% C) {
  
8 ^5 H! V2 ~) ~' e7 y' Y3 R  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ ^6 n* U2 e" G( U- ~' J  
: s' I8 k* X( F0 X: f! E  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   i3 T( u9 M5 Z: g9 y" f
  
, y/ \" c1 [( @9 }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 g: p$ X7 V; Y6 I* P4 A! `0 L1 X
& B4 A( h3 R8 m" h   : P& m! R2 J! r) L$ l
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 i* {, v3 l! d% w! f0 x$ ~9 B   5 c1 d8 \! p$ o4 }" @3 C$ A
  Ping statistics for 192.168.1.21: 7 y3 p5 h! d3 \! Z
   5 ^& Z& m# X( S3 f; B: J
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
4 V  i! x8 w$ F  `3 c2 l   & m7 c) L/ ~! o) `9 F" Y
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
$ I+ Q# I3 T  Y! g7 Q   4 ?% {- i& f" w0 s1 P
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 D, D! b$ H8 g2 w: N
  
3 M5 ?4 R, \) m4 ~7 x, y$ Z  -n count Number of echo requests to send. . q5 Y, [$ c6 A/ U' R/ w9 R/ d- h8 s
   4 c  F  \6 P. c1 P! w6 }+ _
  发送count指定的Echo数据包数。 3 g: |! l$ c$ Y
   ) {+ O- m' S0 }; l' c
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: " D) L0 k" V& U( a3 s6 h3 E1 N* g
  
; j# S$ j# P* |4 W  O" s5 t! G, J  C:\>ping -n 50 202.103.96.68 , i$ z" e# h* c4 ~+ e: q0 T8 y
  
7 \7 f1 Q" t- ~  Pinging 202.103.96.68 with 32 bytes of data:
! l5 v2 q/ X* I  
) x. ]% o* A; I/ U/ P/ M! n, M% H3 r, E  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - X9 D6 N4 N9 Q/ m8 W
     y* s# ^( B+ f# v  q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & t  D) n* e/ {7 D/ I
   ) ]: v) g! N. Q0 b7 Q3 E' u) g( h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  |3 _2 E: c/ I& K  
! @+ q1 ?5 W: X) ~2 V! I7 [1 q  Request timed out. # A: J  I: z# Y* p  g& U
   , W4 G; u! S* `2 e* L- K
  ……………… : F0 {: v  j1 F, O6 x. O" g% f
  
6 W0 B+ O$ [! |. k" f  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( N& Z# u- A( A
  
# s+ _/ B* M5 O/ d; |) T$ a0 l$ g  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 q. w( F5 q4 f; l8 k  
3 B0 p" i" O4 S: i& }* u  Ping statistics for 202.103.96.68: 0 T9 ~+ l+ w& k4 A9 f9 v2 H
   & e3 V0 h! }7 u( u
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ' {  o! \0 \0 X9 C) r0 j, \9 l( D
  
% V  ^0 W  O/ r, T  e  Minimum = 40ms, Maximum = 51ms, Average = 46ms
# W' \6 H* o7 M) |6 @  
9 B7 O9 f) A) i( Y' n* k  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
+ S6 G% S+ M; |& y+ B   , Z( t" Z* K0 G0 I0 j1 ?7 _* ?
  -l size Send buffer size. & [- X, D1 u& o! Y) e% y
  
4 h0 O9 C- g# l6 l$ l) k9 B  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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