EIGRP与OSPF的双点双向重分布

  1. 概述
    双点双向路由重分布的本质问题是不同协议的高低AD值导致次优路径,以及双点双向重分布带来的路由回馈,本次实验将用route-map来解决这个问题
    2.拓扑
    R1在EIGRP中引入直连1.1.1.1/32,R2和R3分别把OSPF引入EIGRP,EIGRP引入OSPF中,当1.1.1.1由R1传给R3,R3引入到OSPF中,AD由170变为110,通过5类LSA传给R4,R4再把这条5类LSA传给R2,对于R2来说,它从两个方向都学习到了1.1.1.1,但是根据AD值,它优选了OSPF的110,下一跳为24.1.1.4,显然。出现了次优路径
  2. 配置
点击查看代码
R2R2(config)#router ospf 110
R2(config-router)#redistribute eigrp 90 subnets 
R2(config)#router eigrp 90
R2(config-router)#redistribute ospf 110 metric 10000 100 255 1 1500
R3R3(config)#router ospf 110
R3(config-router)#redistribute eigrp 90 subnets 
R3(config)#router eigrp 90
R3(config-router)#redistribute ospf 110 metric 10000 100 255 1 1500
此时出现了次优路径的情况
点击查看代码
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O E2     1.1.1.1 [110/20] via 24.1.1.4, 00:00:03, Ethernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/11] via 24.1.1.4, 00:09:49, Ethernet0/1
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.1.1.0/24 is directly connected, Ethernet0/0
L        12.1.1.2/32 is directly connected, Ethernet0/0
      13.0.0.0/24 is subnetted, 1 subnets
D        13.1.1.0 [90/307200] via 12.1.1.1, 00:11:21, Ethernet0/0
      24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        24.1.1.0/24 is directly connected, Ethernet0/1
L        24.1.1.2/32 is directly connected, Ethernet0/1
      34.0.0.0/24 is subnetted, 1 subnets
O        34.1.1.0 [110/20] via 24.1.1.4, 00:09:49, Ethernet0/1
在R2上1.1.1.1下一跳为24.1.1.4。用route-map可以很好的解决这个问题,以及路由回馈的问题
点击查看代码
R2:
R2(config)#route-map  eigrptoospf deny 10
R2(config-route-map)#match tag 170
R2(config)#route-map eigrptoospf permit 20 
R2(config-route-map)#set tag 110
R2(config)#route-map ospftoeigrp deny 10
R2(config-route-map)#match tag 110
R2(config)#route-map ospftoeigrp permit 20
R2(config-route-map)#set tag 170
R2(config-router)#  router ospf 110
R2(config-router)#redistribute eigrp 90 subnets route-map ospftoeigrp 
R2(config)# ip access-list standard R4
R2(config-std-nacl)# permit 1.1.1.1
R2(config)#route-map R4 deny 10
R2(config-route-map)# match ip address R4
R2(config-route-map)#route-map R4 permit 20
R2(config)#router ospf 110
R2(config-router)#distribute-list route-map R4 in

R3:
R3(config)#route-map  eigrptoospf deny 10
R3(config-route-map)#match tag 170
R3(config)#route-map eigrptoospf permit 20 
R3(config-route-map)#set tag 110
R3(config)#route-map ospftoeigrp deny 10
R3(config-route-map)#match tag 110
R3(config)#route-map ospftoeigrp permit 20
R3(config-route-map)#set tag 170
R3(config-router)#  router ospf 110
R3(config-router)#redistribute eigrp 90 subnets route-map ospftoeigrp 
##用route-map匹配和打上tag值,在路由重分布时调用。给EIGRP传到OSPF的路由打上tag110且拒绝带tag170的,OSPF传到EIGRP的路由打上tag170且拒绝带tag110的
R3(config)# ip access-list standard R4
R3(config-std-nacl)# permit 1.1.1.1
R3(config)#route-map R4 deny 10
R3(config-route-map)# match ip address R4
R3(config-route-map)#route-map R4 permit 20
R3(config)#router ospf 110
R3(config-router)#distribute-list route-map R4 in
##在OSPF分发列表处调用,方向是IN方向
用route-map匹配和打上tag值,在路由重分布时调用。给EIGRP传到OSPF的路由打上tag110且拒绝带tag170的,OSPF传到EIGRP的路由打上tag170且拒绝带tag110的。如此解决了路由回馈,用ACL抓取1.1.1.1,用route-map去执行,在OSPF分发列表处调用,如此解决了次优路径的问题。
点击查看代码
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
D EX     1.1.1.1 [170/409600] via 12.1.1.1, 00:17:22, Ethernet0/0
      4.0.0.0/32 is subnetted, 1 subnets
O        4.4.4.4 [110/11] via 24.1.1.4, 00:27:13, Ethernet0/1
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.1.1.0/24 is directly connected, Ethernet0/0
L        12.1.1.2/32 is directly connected, Ethernet0/0
      13.0.0.0/24 is subnetted, 1 subnets
D        13.1.1.0 [90/307200] via 12.1.1.1, 00:28:45, Ethernet0/0
      24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        24.1.1.0/24 is directly connected, Ethernet0/1
L        24.1.1.2/32 is directly connected, Ethernet0/1
      34.0.0.0/24 is subnetted, 1 subnets
O        34.1.1.0 [110/20] via 24.1.1.4, 00:27:13, Ethernet0/1

点击查看代码
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      4.0.0.0/32 is subnetted, 1 subnets
D EX     4.4.4.4 [170/307200] via 13.1.1.3, 00:26:37, Ethernet0/1
                 [170/307200] via 12.1.1.2, 00:26:37, Ethernet0/0
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.1.1.0/24 is directly connected, Ethernet0/0
L        12.1.1.1/32 is directly connected, Ethernet0/0
      13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        13.1.1.0/24 is directly connected, Ethernet0/1
L        13.1.1.1/32 is directly connected, Ethernet0/1
      24.0.0.0/24 is subnetted, 1 subnets
D EX     24.1.1.0 [170/307200] via 13.1.1.3, 00:26:37, Ethernet0/1
                  [170/307200] via 12.1.1.2, 00:26:37, Ethernet0/0
      34.0.0.0/24 is subnetted, 1 subnets
D EX     34.1.1.0 [170/307200] via 13.1.1.3, 00:26:37, Ethernet0/1
                  [170/307200] via 12.1.1.2, 00:26:37, Ethernet0/0
点击查看代码
R4#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O E2     1.1.1.1 [110/20] via 24.1.1.2, 00:18:14, Ethernet0/0
      4.0.0.0/32 is subnetted, 1 subnets
C        4.4.4.4 is directly connected, Loopback0
      12.0.0.0/24 is subnetted, 1 subnets
O E2     12.1.1.0 [110/20] via 34.1.1.3, 00:26:58, Ethernet0/1
                  [110/20] via 24.1.1.2, 00:27:10, Ethernet0/0
      13.0.0.0/24 is subnetted, 1 subnets
O E2     13.1.1.0 [110/20] via 34.1.1.3, 00:26:58, Ethernet0/1
                  [110/20] via 24.1.1.2, 00:27:10, Ethernet0/0
      24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        24.1.1.0/24 is directly connected, Ethernet0/0
L        24.1.1.4/32 is directly connected, Ethernet0/0
      34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        34.1.1.0/24 is directly connected, Ethernet0/1
L        34.1.1.4/32 is directly connected, Ethernet0/1
posted @   edisonchen1  阅读(65)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示