设为首页收藏本站language 语言切换
查看: 2575|回复: 1
收起左侧

route distribute-list configuare

[复制链接]
发表于 2009-12-11 21:39:36 | 显示全部楼层 |阅读模式
诶,越来越吃力了,CCNP真的那么难呀,不过功夫不负有心人,昨天晚上看1小时书,加今天机房里2小时的反复实验终于成功了,路由器之间都能够learing相互之间的route。

今天带来的是CCNP BSCI distribute-list configuare,用来filter用户禁止向外通告的路由。过滤规则基于ACL上的标准语句。
Such as:一开始我是想根据书上面的实例进行路由实验的,当我做到一半时,我脑子一灵光想到了一个很有趣的路由学习规则,这仅供学习使用,在实际上这根本就是一个非常错误的设计,但我们这里就是为了让自己深刻理解这个知识点。准备好了么,ready go !
要求:
在r1路由器的ospf中使用重分发列表过滤掉RIP过来的10.3.0.0/16路由条目,同样,
在r1路由器的rip中使用重分发列表过滤掉OSPF过来的10.10.0.0/16 10.11.0.0/16路由条目。
这里再添加进我刚才的想法,就是在R3路由器上配置雷同R1一样并在两边进行重分发路由协议。但是在R1上配置加2条acl 3、4让刚才被过滤掉的路由经过路由器R2-R3-R1进行再传递到R2中。具体配置如下。
r0#show running
<output omit!>
interface Loopback0
ip address 10.1.0.1 255.255.0.0
!
interface Loopback1
ip address 10.2.0.1 255.255.0.0
!
interface Loopback2
ip address 10.3.0.1 255.255.0.0
!
interface Serial0/0
ip address 10.0.0.2 255.255.255.252
serial restart-delay 0
!
interface Serial0/1
ip address 10.0.0.66 255.255.255.252
serial restart-delay 0
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
router rip
version 2
network 10.0.0.0
!
<output omit!>
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
end


r0#show running
<...>
interface Loopback0
ip address 10.8.0.1 255.255.0.0
!
interface Loopback1
ip address 10.9.0.1 255.255.0.0
!
interface Loopback2
ip address 10.10.0.1 255.255.0.0
!
interface Loopback3
ip address 10.11.0.1 255.255.0.0
!
interface Serial0/0
ip address 10.0.0.10 255.255.255.252
serial restart-delay 0
no fair-queue
!
interface Serial0/1
ip address 10.0.0.34 255.255.255.252
serial restart-delay 0
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
network 10.0.0.10 0.0.0.0 area 0
network 10.0.0.34 0.0.0.0 area 0
network 10.8.0.1 0.0.0.0 area 1
network 10.9.0.1 0.0.0.0 area 1
network 10.10.0.1 0.0.0.0 area 1
network 10.11.0.1 0.0.0.0 area 1

line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
end

r1#show running
<output omit!>
interface Serial0/0
ip address 10.0.0.1 255.255.255.252
serial restart-delay 0
clock rate 64000
no fair-queue
!
interface Serial0/1
ip address 10.0.0.9 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
redistribute rip subnets
passive-interface Serial0/0
network 10.0.0.9 0.0.0.0 area 0
distribute-list 1 out rip
distribute-list 3 in Serial0/1
!
router rip
version 2
redistribute ospf 1 metric 5
passive-interface default
no passive-interface Serial0/0
network 10.0.0.0
distribute-list 2 out Serial0/0
distribute-list 4 in Serial0/0
!
access-list 1 permit 10.1.0.0 0.0.255.255
access-list 1 permit 10.2.0.0 0.0.255.255
access-list 2 permit 10.8.0.0 0.0.255.255
access-list 2 permit 10.9.0.0 0.0.255.255
access-list 3 deny   10.2.0.0 0.0.255.255
access-list 3 deny   10.1.0.0 0.0.255.255
access-list 3 permit any
access-list 4 deny   10.8.0.0 0.0.255.255
access-list 4 deny   10.9.0.0 0.0.255.255
access-list 4 permit any
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end


r3#show running
<output omit!>
interface Serial0/0
ip address 10.0.0.65 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial0/1
ip address 10.0.0.33 255.255.255.252
serial restart-delay 0
clock rate 64000
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
router ospf 1
log-adjacency-changes
redistribute rip metric 30 subnets
network 10.0.0.32 0.0.0.3 area 0
!
router rip
version 2
redistribute ospf 1 metric 6
passive-interface default
no passive-interface Serial0/0
network 10.0.0.0
!
<out omit!>

line con 0
line aux 0
line vty 0 4
!
!
end


所有的配置都好了,大家要仔细看哦,很多细节一旦忽略了,就整条思路就断了的。嘿嘿!
接下来给show 出各个路由器的路由条目.
r0# show ip route
<out omit!>

     10.0.0.0/8 is variably subnetted, 11 subnets, 3 masks
R       10.11.0.1/32 [120/6] via 10.0.0.65, 00:00:24, Serial0/1
R       10.10.0.1/32 [120/6] via 10.0.0.65, 00:00:24, Serial0/1
R       10.9.0.1/32 [120/5] via 10.0.0.1, 00:00:02, Serial0/0
R       10.0.0.8/30 [120/6] via 10.0.0.65, 00:00:24, Serial0/1
R       10.8.0.1/32 [120/5] via 10.0.0.1, 00:00:02, Serial0/0
C       10.2.0.0/16 is directly connected, Loopback1
C       10.3.0.0/16 is directly connected, Loopback2
C       10.0.0.0/30 is directly connected, Serial0/0
C       10.1.0.0/16 is directly connected, Loopback0
R       10.0.0.32/30 [120/1] via 10.0.0.65, 00:00:24, Serial0/1
C       10.0.0.64/30 is directly connected, Serial0/1

r2# show ip route
<out omit!>

     10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
C       10.10.0.0/16 is directly connected, Loopback2
C       10.11.0.0/16 is directly connected, Loopback3
C       10.8.0.0/16 is directly connected, Loopback0
C       10.0.0.8/30 is directly connected, Serial0/0
C       10.9.0.0/16 is directly connected, Loopback1
O E2    10.2.0.0/16 [110/20] via 10.0.0.9, 00:46:04, Serial0/0
O E2    10.3.0.0/16 [110/30] via 10.0.0.33, 00:46:04, Serial0/1
O E2    10.0.0.0/30 [110/30] via 10.0.0.33, 00:46:04, Serial0/1
O E2    10.1.0.0/16 [110/20] via 10.0.0.9, 00:46:04, Serial0/0
C       10.0.0.32/30 is directly connected, Serial0/1
O E2    10.0.0.64/30 [110/30] via 10.0.0.33, 00:46:04, Serial0/1

r3#show ip route
<out omit!>
     10.0.0.0/8 is variably subnetted, 11 subnets, 3 masks
O IA    10.11.0.1/32 [110/65] via 10.0.0.34, 00:46:42, Serial0/1
O IA    10.10.0.1/32 [110/65] via 10.0.0.34, 00:46:42, Serial0/1
O IA    10.9.0.1/32 [110/65] via 10.0.0.34, 00:46:42, Serial0/1
O       10.0.0.8/30 [110/128] via 10.0.0.34, 00:46:42, Serial0/1
O IA    10.8.0.1/32 [110/65] via 10.0.0.34, 00:46:42, Serial0/1
O E2    10.2.0.0/16 [110/20] via 10.0.0.34, 00:46:42, Serial0/1
R       10.3.0.0/16 [120/1] via 10.0.0.66, 00:00:04, Serial0/0
R       10.0.0.0/30 [120/1] via 10.0.0.66, 00:00:04, Serial0/0
O E2    10.1.0.0/16 [110/20] via 10.0.0.34, 00:46:42, Serial0/1
C       10.0.0.32/30 is directly connected, Serial0/1
C       10.0.0.64/30 is directly connected, Serial0/0

r1#show ip route
<out omit!>
     10.0.0.0/8 is variably subnetted, 11 subnets, 3 masks
O IA    10.11.0.1/32 [110/65] via 10.0.0.10, 00:47:24, Serial0/1
O IA    10.10.0.1/32 [110/65] via 10.0.0.10, 00:47:24, Serial0/1
O IA    10.9.0.1/32 [110/65] via 10.0.0.10, 00:47:24, Serial0/1
C       10.0.0.8/30 is directly connected, Serial0/1
O IA    10.8.0.1/32 [110/65] via 10.0.0.10, 00:47:24, Serial0/1
R       10.2.0.0/16 [120/1] via 10.0.0.2, 00:00:26, Serial0/0
O E2    10.3.0.0/16 [110/30] via 10.0.0.10, 00:47:24, Serial0/1
C       10.0.0.0/30 is directly connected, Serial0/0
R       10.1.0.0/16 [120/1] via 10.0.0.2, 00:00:26, Serial0/0
O       10.0.0.32/30 [110/128] via 10.0.0.10, 00:47:24, Serial0/1
O E2    10.0.0.64/30 [110/30] via 10.0.0.10, 00:47:24, Serial0/1

3.jpg
发表于 2013-8-19 01:07:31 | 显示全部楼层
沙发 2013-8-19 01:07:31 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-5-24 05:22 , Processed in 0.129213 second(s), 28 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

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