1、实验拓扑
2、基础配置
R1配置
interface Serial0/0
ip address 14.1.1.1 255.255.255.0
interface Serial0/1
ip address 13.1.1.1 255.255.255.0
R2配置
interface Serial0/0
ip address 24.1.1.2 255.255.255.0
interface Serial0/1
ip address 23.1.1.2 255.255.255.0
R3配置
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface Serial0/0
ip address 13.1.1.3 255.255.255.0
interface Serial0/1
ip address 23.1.1.3 255.255.255.0
R4配置
interface Loopback0
ip address 4.4.4.4 255.255.255.0
interface Serial0/0
ip address 14.1.1.4 255.255.255.0
interface Serial0/1
ip address 24.1.1.4 255.255.255.0
3、RIP和OSPF双向重分布(有问题)
R1配置
router ospf 110
router-id 1.1.1.1
redistribute rip subnets
network 13.1.1.0 0.0.0.255 area 0
router rip
version 2
redistribute ospf 110 metric 1
network 14.0.0.0
no auto-summary
R2配置
router ospf 110
router-id 2.2.2.2
redistribute rip subnets
network 23.1.1.0 0.0.0.255 area 0
router rip
version 2
redistribute ospf 110 metric 1
network 24.0.0.0
no auto-summary
R3配置
router ospf 110
router-id 3.3.3.3
network 3.3.3.0 0.0.0.255 area 0
network 13.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
R4配置
router rip
version 2
network 4.0.0.0
network 14.0.0.0
network 24.0.0.0
no auto-summary
此时我们发现R1和R2上都有路由是不正常的,主要是因为AD值引起的。
比如R1从RIP和OSPF都学到4.4.4.0/24和24.1.1.0/24这两条路由,按理说应该选择从RIP学到的路由比较合理,但是因为OSPF的AD比RIP的小,所有R1优先选择从OSPF学过来的路由。所有只要将重分布进OSPF的RIP的AD改为比120大即可解决该问题。
R1配置
router ospf 110
distance 121 2.2.2.2 0.0.0.0
R2配置
router ospf 110
distance 121 1.1.1.1 0.0.0.0
后面接的是RID。
4、RIP和EIGRP双向重分布(没问题)
R1配置
router eigrp 90
redistribute rip metric 1500 100 255 1 1500
network 13.1.1.0 0.0.0.255
auto-summary
router rip
version 2
redistribute eigrp 90 metric 1
network 14.0.0.0
no auto-summary
R2配置
router eigrp 90
redistribute rip metric 1500 100 255 1 1500
network 23.1.1.0 0.0.0.255
no auto-summary
router rip
version 2
redistribute eigrp 90 metric 1
network 24.0.0.0
no auto-summary
R3配置
router eigrp 90
network 3.3.3.0 0.0.0.255
network 13.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
no auto-summary
R4配置
router rip
version 2
network 4.0.0.0
network 14.0.0.0
network 24.0.0.0
no auto-summary
5、OSPF和EIGRP双向重分布(没问题)
R1配置
router eigrp 90
redistribute ospf 110 metric 1500 100 255 1 1500
network 13.1.1.0 0.0.0.255
auto-summary
router ospf 110
router-id 1.1.1.1
redistribute eigrp 90 subnets
network 14.1.1.0 0.0.0.255 area 0
R2配置
router eigrp 90
redistribute ospf 110 metric 1500 100 255 1 1500
network 23.1.1.0 0.0.0.255
no auto-summary
router ospf 110
router-id 2.2.2.2
redistribute eigrp 90 subnets
network 24.1.1.0 0.0.0.255 area 0
R3配置
router eigrp 90
network 3.3.3.0 0.0.0.255
network 13.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
no auto-summary
R4配置
router ospf 110
router-id 4.4.4.4
network 4.4.4.0 0.0.0.255 area 0
network 14.1.1.0 0.0.0.255 area 0
network 24.1.1.0 0.0.0.255 area 0
可以看出EIGRP与RIP或OSPF双向重分布是不存在问题的,RIP和OSPF之前就会存在双向重分布问题。