4路由策略_route-map(避免路由反馈)

预备知识:
J 管理距离:
         同一个网络可能使用多种路由选择协议和静态路由。如果有多个路由选择信息源,将根据管理距离来评估每个路由选择信息源的可信度。
         管理距离是一个 0~255 的整数。路由选择协议的管理距离越小,其可信度越高,如表 1 列出了一些路由选择信息的默认管理距离。
1 默认管理距离
路由选择信息源
默认管理距离
直连接口
0
静态路由
1
OSPF
110
RIPv1 RIPv2
120
未知或不可信
255
配置目的:避免路由反馈,使 R3 不收到重复的 192.168.1.0/24 的路由信息。
拓扑图:
说明:在 R1 R2 上进行双敛双 UP 重分发,在 RIP 网络中如果是 R1 先收到 R3 192.168.1.0/24 ,并在重分发时将它注入进 OSPF ,因为 OSPF 的管理距离比 RIP 的可信( OSPF 110 RIP 120 ,越小越可信),所以 R2 的路由表中 192.168.1.0/24 这条路由是通过 OSPF 学习到的如下:
R2
r2#SH IP ROU
     1.0.0.0/24 is subnetted, 1 subnets
O E2    1.1.1.0 [110/20] via 4.4.4.2, 00:34:50, Serial0/1
     2.0.0.0/24 is subnetted, 1 subnets
O       2.2.2.0 [110/128] via 4.4.4.2, 00:34:50, Serial0/1
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, Serial0/0
     4.0.0.0/24 is subnetted, 1 subnets
C       4.4.4.0 is directly connected, Serial0/1
O E2 192.168.1.0/24 [110/20] via 4.4.4.2, 00:34:50, Serial0/1
r2#
通过上面 show ip route 看到 R2 是通过 OSPF 学习到的 192.168.1.0/24 这条路由!!!
可以知道我们在 R1 R2 上都配置了双重分发, R2 又会将它通过 OSPF 学习到的这条 192.168.1.0/24 路由通过 RIP 重分发注入 RIP 网络,让 R3 收到,但 192.168.1.0/24 这条路由是 R3 的直连路由, R3 通过RIP 收到的这条192.168.1.0/24 是没意义的,这样会浪费路由的CPU 资源!!! 所以我们要在 R1 R2 上应用 route-map 的强大功能来避免 192.168.1.0/24 这条路由重分发进 RIP 网络!!!
配置参数:
R1:
access-list 1 permit 192.168.1.0
route-map ospf deny 10
 match ip address 1
route-map ospf permit 20
router ospf 1
redistribute rip metric 20 subnets
 network 2.2.2.0 0.0.0.255 area 0
router rip
 version 2
 redistribute ospf 1 metric 1 route-map ospf
 network 1.0.0.0
 no auto-summary
R2:
access-list 1 permit 192.168.1.0 0.0.0.255
route-map ospf deny 10
 match ip address 1
route-map ospf permit 20
router ospf 1
redistribute rip metric 20 subnets
 network 4.4.4.0 0.0.0.255 area 0
router rip
 version 2
 redistribute ospf 1 metric 1 route-map ospf
 network 3.0.0.0
 no auto-summary
配置完毕!!!

你可能感兴趣的:(GNS3,重分发,CCPN)