路由策略3_Distribute-list5

本文涉及的产品
云数据库 Redis 版,社区版 2GB
推荐场景:
搭建游戏排行榜
简介:
拓扑图:
没配置分发列表前:
R2:
router ospf 1
redistribute connected metric 10 subnets
 redistribute rip metric 30 subnets
 network 192.168.23.0 0.0.0.255 area 0
!
router rip
 version 2
 redistribute connected metric 2
 redistribute ospf 1 metric 4
 network 192.168.12.0
 no auto-summary
查看各路由器的路由表:
r1#sh ip rou
C    192.168.12.0/24 is directly connected, Serial0/0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/24 is subnetted, 1 subnets
R       2.2.2.0 [120/2] via 192.168.12.2, 00:00:17, Serial0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, Loopback1
R    192.168.23.0/24 [120/2] via 192.168.12.2, 00:00:17, Serial0/0
r1#
r2#sh ip rou
C    192.168.12.0/24 is directly connected, Serial0/0
     1.0.0.0/24 is subnetted, 1 subnets
R       1.1.1.0 [120/1] via 192.168.12.1, 00:00:11, Serial0/0
     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 1 subnets
R       10.10.10.0 [120/1] via 192.168.12.1, 00:00:11, Serial0/0
C    192.168.23.0/24 is directly connected, Serial0/1
r2#
r3#sh ip rou
O E2 192.168.12.0/24 [110/10] via 192.168.23.1, 00:00:22, Serial0/0
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/30] via 192.168.23.1, 00:00:22, Serial0/0
     2.0.0.0/24 is subnetted, 1 subnets
O E2    2.2.2.0 [110/10] via 192.168.23.1, 00:00:22, Serial0/0

     10.0.0.0/24 is subnetted, 1 subnets
O E2    10.10.10.0 [110/30] via 192.168.23.1, 00:00:09, Serial0/0

C    192.168.23.0/24 is directly connected, Serial0/0r3#
可以看到各路由器都学习到了全网的路由!
下面配置分发列表:
R2
access-list 1 permit 1.1.1.0 0.0.0.255
router ospf 1
distribute-list 1 out rip // 配置分发列表,关联ACL 序号1 ,应用在出接口,协议为RIP ;这里的RIP 是指重发布的来源为RIP 协议(过渡从RIP 网络重发布过来的,其它路由协议的路由不受影响,如下,R2 的直连路由2.2.2.2/24 没有被过渡掉)
S 注意: distribute-list 1  后面如何要加协议的话只能在 OUT 方向, IN 方向无此功能!!!

查看 R3 的路由表:
r3#sh ip rou
O E2 192.168.12.0/24 [110/10] via 192.168.23.1, 00:01:03, Serial0/0
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/30] via 192.168.23.1, 00:01:03, Serial0/0
     2.0.0.0/24 is subnetted, 1 subnets
O E2    2.2.2.0 [110/10] via 192.168.23.1, 00:01:03, Serial0/0

C    192.168.23.0/24 is directly connected, Serial0/0
r3#
可以看出 R3 只学习到了 RIP 网络的 1.1.1.1/24 ,那为什么 2.2.2.0/24 还在呢?因为它是 R2 的直连路由而不是 RIP 网络的路由!!!


      本文转自810105851 51CTO博客,原文链接http://blog.51cto.com/4708948/1131442 :,如需转载请自行联系原作者



相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
相关文章
|
网络协议 数据建模 网络架构