a我考网

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 81|回复: 0

[综合] Cisco路由配置:路由器缺省路由及相关配置1

[复制链接]
发表于 2012-8-3 20:03:30 | 显示全部楼层 |阅读模式
1proxy arp4 M: j. \( W. `3 V# H# c8 s1 L
    7 i5 E8 F9 G; G2 m
    代理arp被路由器作为向主机表明自身可用的一种手段,在这个实验里 面,我们将R1和R3仿真成终端主机,当R1需要R3发送报文时(目的为。3),在没有配置默认网关的情况下,R1可以向12.1.1.2发送一个ARP 请求,本地路由器R2收到这个请求后,并且知道如何到达网络3.3.3.0因此路由器将回复以上请求。其中把自己的数据链路标示作为ARP回复报文中的硬 件地址。事实上,路由器欺骗了本地的主机R1,让他认为路由器的接口就是3.3.3.3的接口,最终所有发向3.3.3.3的报文都被送往路由器。" ?: Z- e5 X8 i' l1 E
   
* j! Z5 x; q( H; u! J    以下实验R2和R3通过OSPF保持连通,而R1仿真为终端,注意R1不可配置环回口,否则默认ARP请求会发向环回口。
1 O* t! f/ j6 z+ j( Y9 }6 Z    , f, w! \) K7 ]# r/ S& J! ?
    R3(config)#interface loopback 0$ P  K; [7 z7 @1 I- E. f% @0 a
   
3 W; l! |7 s' s    R3(config-if)#ip address .3 255.255.255.0 secondary% k5 s9 Z. U3 {7 s7 o
   
8 D+ s* }( R. z8 W    R3(config-if)#ip address .2 255.255.255.0 secondary* V3 v( {8 U, W
    , @% u# n1 g  T/ x/ [' [: K) I8 B
    R3(config-if)#ip address .1 255.255.255.0 secondary
6 \) \/ o, X% U  \$ Y    % [$ T7 i$ V/ |, h2 t! N" r. ]
    R3(config-if)#ip address .4 255.255.255.0 secondary' C# p( }, g  x: c
    $ F5 \9 h. M6 h  A9 q
    R3(config-if)#ip address .3 255.255.255.0
$ v1 ^4 D8 r; ^    ! X5 L( m2 w: \- [( u5 U( w
    R3(config-if)#ip ospf network point-to-point; K+ n( w/ P5 _) A
   
  [! |0 X# c+ {. I; M2 m    R3(config)#interface serial1. U+ D' v% j0 ]  ?! m/ g
    8 I$ A% b6 w- Z; z/ Q+ |1 O
    R#(config-if)#ipaddress .3 255.255.255.0
! b! q3 }- e$ R    8 m6 f$ \9 a; B" A& Y
    R3(config-if)#router ospf 10( N5 X1 n1 E; f- m/ L1 A
   
) ^1 y7 F) I3 L( p& }  {) L. Y    R3(config-router)#router-id .35 V9 d- m0 N/ C# t
    0 M$ O+ z, W- r0 c/ l& d
    R3(config-router)#network .0 255.255.255.255 area 0# X7 s$ O) i& r5 M% N
    ( A9 |; C9 e/ I- H: K
    R2(config)#interface loopback 0
. ]; t/ `; n  c" v6 e0 _+ U  e   
+ w# \/ W' v/ R; g3 W    R2(config-if)#ip address .2 255.255.255.04 \/ g' b* g( Z" I% j
    ( I+ i9 }, y6 |- |1 }
    R2(config-if)#ip ospf network point-to-point
/ n  }" O% K3 G4 i' u5 F   
5 L9 g! M7 @% n7 f  ?- F. V$ S    R2(config-if)#interface serial 1/ U2 y2 p" _* O4 S  m; [$ Z
    3 e+ m- \( L$ |  S- ^1 k+ ^  R9 i$ B
    R2(config-if)#ip address .2 255.255.255.0, \8 N) x9 K& s7 o/ r4 _  _
    ; w; d. n% N5 S: S. F6 X* ~
    R2(config-if)#clockrate 64000& q/ l& C6 U! M
    # A! B5 N; L3 x& [
    R2(config-if)#no shut
8 `" C# h8 `& ?' g( ~. o/ `* v    % N3 J- A2 N+ l4 A- q- {$ a1 a" a! H
    R2(config)#interface ethernet 0) s2 [  m. G, k
    $ C8 t3 y0 ^: Y+ h# |/ a2 z% y
    R2(config-if)#ip address 112.1.1.2 255.255.255.0
- ?' \; Z  `0 ]; ?, @! K- [5 k   
$ B0 ^- I1 }8 ~7 |  t! X5 L$ Z* h    R2(config-if)#router ospf 10
* Y' u* a: |% Q    . @9 G9 [, h: C$ V3 G, q) z
    R2(config-router)#router-id .25 ]2 I& ~- c, W& `
   
% K; n- z8 e6 T+ a2 h    R2(config-router)#network .0 255.255.255.255 area 0" c  k. n' R, \) t
    / ?2 F" n7 |1 G; _4 G) d$ F; G, m
    R1(config)#interface ethernet 07 _8 S" l% O, Z3 V8 A8 m  m
      s+ k) B7 q' [: h) N- q9 ~) `+ F
    R1(config-if)#ip address 112.1.1.1 255.255.255.0  N8 i2 \0 v; M: h1 j* G
    & v' m5 w8 {% `( ?- Z7 U# r; k; W
    此时,这种情况下,R1没有R3的路由,R1根本不会去发送ARP请求来解析目的地址,通过以下配置,将R1的路由功能关闭,这个时候R1犹如一个终端主机。    5 S% j/ R, s0 c2 a6 t  k$ b
    R1(config-if)#no ip routing
$ O1 j# A3 a: m/ ~$ q' ]   
0 s: P% m" ]9 [% M* j5 v+ f, ~    此时查看R1的路由表2 E- T% ?/ m+ _8 n8 {/ n
    4 d# t8 K' f: T( R. n/ l2 j
    R1#show ip route
$ u7 B7 W- D5 U) N" u7 ]1 N   
! M/ M0 [' v: Y    Default gateway is not set0 l. q- j" [8 Z6 v
    % P+ {# r, h# X9 o5 q! Q
    Host               Gateway           Last Use    Total Uses Interface
- r9 U$ x& e& u! X, I; w    9 Z& ^3 Q: e& r. g
    ICMP redirect cache is empty
' v3 ^0 z+ f6 ?: G2 L    9 P$ C# p0 ?/ F) B$ k* `/ _0 g& o
    R1#traceroute .39 b: z6 S) D0 m+ C$ m
    & w% [4 \* r0 A, w7 i5 n: |- g
    Type escape sequence to abort.7 e+ u' l9 G* F. E: x, ?7 T
   
) H  m/ u; z7 \, i0 N9 w    Tracing the route to .3$ `0 A, w0 O9 w9 m4 E/ ?3 K! w
   
6 y7 t* k( ~1 ?    1 112.1.1.2 4 msec 4 msec 4 msec
- N6 s3 d: p" c5 S    % K! d4 _# m9 Q; x
    2 .3 16 msec 20 msec *
# G4 p) a+ N( x4 u. y; f( q    + U" s$ f" ^1 c4 w
    R1 能够到达R3,是因为R1关闭了路由功能后,在没有设置默认的网关的情况下,会对所有不可知的地址,发送广播ARP请求,R2的E0接口收到请求后,查看 路由表是否有。3的对用路由,如有,便用其接受到请求的接口的MAC应答ARP.我们在R1上面同时ping多个地址,验证这一点:' I  f& L$ W9 F+ h. P) `0 N4 P& R
   
, R+ }" H/ G# R) t% f* h    R1分别ping.1 3.3.3.3 3.3.3.4
; i% i! ~3 L5 F( {& W   
5 l9 @! v4 b1 q1 X5 u# y    R1#show arp; K# v" r& S+ d& \- X9 \
    * _* x- M7 A5 E4 g
    Protocol Address          Age (min) Hardware Addr   Type   Interface
- y9 I, e& r5 A' _- l# j" e' z    # {: M7 V: ~8 Q) a* m3 S- ^
    Internet .3                 4   0010.7b80.4c86 ARPA   Ethernet0
' C, g1 e7 D" a' `    , z3 A) K9 R! ?# u" j
    Internet .2                 0   0010.7b80.4c86 ARPA   Ethernet0' p9 {% r# h6 I& \6 H2 J' Y
   
; P+ g0 K& i# _, [    Internet .1                 0   0010.7b80.4c86 ARPA   Ethernet0
  i8 T/ W3 d4 A8 B0 L  o" x) t, h   
* z. y$ x& A3 z% Q1 ^5 r) v    Internet .4                 0   0010.7b80.4c86 ARPA   Ethernet0
2 z1 X# e! Z' s. ~6 C    ; ~4 R% }0 `; g, D
    Internet 112.1.1.1               -   0030.94e5.ca62 ARPA   Ethernet0
0 R- n0 B7 ?. S& }- b5 R0 v2 g4 c    1 K1 {' K. L2 A1 a, Q. g1 [- ~
    Internet 112.1.1.2               4   0010.7b80.4c86 ARPA   Ethernet0
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Woexam.Com ( 湘ICP备18023104号 )

GMT+8, 2024-4-29 13:29 , Processed in 0.181404 second(s), 21 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表