返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 " R3 x0 |/ u! m7 }5 e& x
   , s  E5 f  L: J% k6 h8 v; T
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
7 M7 k: r7 @: ~' R" W' s     [' W( q3 p3 Z( P& V% K
  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 0 G6 r5 ], C/ v4 F- l: z+ e8 h
   ' W  F7 u2 l) ?. _6 u) G
  Options:
; e9 L6 N  ?5 e  H   6 w+ U( g6 l* Z6 Z+ z9 D5 l
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. # `0 I6 L$ U) p% `, r$ l% s
  
- l; l" j, G4 u9 g  不停的ping地方主机,直到你按下Control-C。
2 l: w5 c2 l  O+ N/ H+ t) D' V* \   7 N0 C5 m, W, G/ z: A% J* o
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
% K7 G7 G% q: Z( F   % o  |5 M! E) [" h
  -a Resolve addresses to hostnames.
# H1 m  z2 v5 `6 ]/ P* j   " s6 T# t1 r# C; A
  解析计算机NetBios名。
& @" a7 B5 Y1 R3 V& M  
; o" W1 }8 h+ s9 C2 Y3 C  示例:C:\>ping -a 192.168.1.21 / C4 N8 T8 M% p% y1 O9 ?2 h
  
9 J3 J$ J* q! B# n2 F3 i! t$ j  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ! F3 H: A; A" a4 Z5 c8 B
   ; a2 o8 O) x  I& `, ]8 u- q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 O( W! c/ i/ q   # k" Y" _: q- Z4 a$ ?' L$ L+ _1 |$ B- E
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# y3 y2 [" C3 h* a3 H# W   9 [5 v+ ]" H" U+ T
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 ]7 m# i; w; O3 N5 @0 ?& F
! P' m) d' q! m4 M% e
   7 z9 c5 q# f( f5 R4 d. q* x' H  c
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 _' D) `  z# g! V0 X: R
  
9 x& _; R8 |: |. Y  Ping statistics for 192.168.1.21:
- _# }8 X- t; q: p3 y7 v   3 w: i# R2 T" W) J! H* @: n
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: - g1 E4 P( e) a* I
  
$ p( E8 ~# E$ e/ E4 F* }  Minimum = 0ms, Maximum = 0ms, Average = 0ms 0 M9 E1 O! D. t  u; ?
  
2 P/ c) Z* x% f. {) c  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 $ o" E& s, k" G% o# S3 @5 p' x
  
# o9 q, S6 K, [" Q( v# A  -n count Number of echo requests to send. 0 O' e& k2 A5 `, H. p
  
- f# C  i; U7 z  发送count指定的Echo数据包数。 4 o2 k3 X$ W4 B* h$ S$ ?: r4 l! j
  
& j: Y; r9 N4 U5 j  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: $ H+ w. r& Z5 V! A( }0 b! Q. B
  
$ g7 [3 l% Y( V* J: U' n! L9 q+ R" l  C:\>ping -n 50 202.103.96.68 ; T( \; a. A, [& O3 j$ s* }+ E- }
   " |0 d1 w. B: o- ~
  Pinging 202.103.96.68 with 32 bytes of data:
* r3 t  m$ q! c/ Z0 }- K( O   2 y# }  g/ @: V* W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! t  q& n; F4 e6 `$ F% o) k' k
  
( t; h8 l2 N3 Z6 |, i  y, p  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 ]: C# q$ f; o; k, m3 t   * Y7 s1 L/ i+ h+ W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 H% z2 K& o" q" O   & S  S" A& f* a  X2 Z& D
  Request timed out.
  e; v- }) z( |$ `" q- d8 P! i8 t( {4 ^  
; r: C6 P; H' b" a' D% a% G  ………………
7 {: u( g) t7 d! G5 w  
% S- h' m) X2 f; n  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # L+ u0 g1 k  r  ~
  
, p4 a- v' o* }9 i2 Y3 h  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ w  ^0 S6 a+ \   & _6 x+ U& V* s- p) p$ n' {
  Ping statistics for 202.103.96.68:
- M  N0 g& N0 p7 ?# I1 j   0 o7 ?# X0 {9 p6 S5 X& o' ~! `3 F
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
' L3 @6 k" |" c$ t   7 D: z- E6 @" {/ B
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
! W8 w: c$ O; f- l$ n0 W3 W2 I3 y$ o  
4 e" ?# h+ Z5 g4 ]( \  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- f6 e/ d+ j. Z7 i   0 L5 k4 u3 |9 L" h
  -l size Send buffer size.
1 b  x6 \' d3 l6 v0 {4 i     v1 ~. @7 ?% U7 _
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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