CCNP实验---双点双向路由重分布问题

1、实验目的:使用RIP和OSPF进行双点双向重分布,实现网络互通和冗余备份。

2、实验环境:C3640-IK9O3S-M Version 12.4(10)

3、实验拓扑


4、实验描述

该网络中,R1、R2同时运行RIP和OSPF,而R3运行OSPF,R4运行RIP,并在R3、R4上模拟两个子网。这样R3和R4并不能互相学习到对方的子网信息,这时我们需要采用路由重分布进行解决。实际上,我们只需在R1或者R2上部署路由重分布就可以让R3与R4互访子网,但我们为了保证网络的高可用性,让R1和R2同时进行路由重分布。

这时问题出现了,当进行R1和R2都进行双向重分布时,会出现R2(R1)访问4.4.4.0/24网络时先经过R3到R1(R2)最后才到达R4。而不是选择最优的路径,直接到达R4。因为在进行双点双向重分布时,R1将重分布进OSPF的4.4.4.0/24的网络传给R2,由于OSPF的AD值90>RIP的AD 值120,所以R2将使用从R1学习到4.4.4.0/24的网络。

为了解决这个问题,那么可以通过修改OSPF的AD值,当R2从R1学到的关于OSPF的AD值>RIP的AD值,即可解决这个问题

5、实验步骤:

A、R1基本配置

interface Serial0/0
ip address 14.0.0.1 255.255.255.0
!
interface Serial0/1
ip address 13.0.0.1 255.255.255.0
!

B、R2基本配置

interface Serial0/0
ip address 23.0.0.2 255.255.255.0
!
interface Serial0/1
ip address 24.0.0.2 255.255.255.0
!

C、R3基本配置

interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Serial0/0
ip address 23.0.0.3 255.255.255.0
!
interface Serial0/1
ip address 13.0.0.3 255.255.255.0
!

D、R4基本配置

interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Serial0/0
ip address 14.0.0.4 255.255.255.0
!
interface Serial0/1
ip address 24.0.0.4 255.255.255.0
!

E、R1路由协议配置

router ospf 1
router-id 1.1.1.1
//将RIP重分布进OSPF
redistribute rip subnets

network 13.0.0.0 0.0.0.255 area 0
!
router rip
version 2
//将OSPF重分布进RIP,并将metric值设为5。如果没有设置,metric值默认是无穷大
redistribute ospf 1 metric 5

network 14.0.0.0
no auto-summary

F、R2路由协议配置

router ospf 1
router-id 2.2.2.2
//将RIP重分布进OSPF
redistribute rip subnets

network 23.0.0.0 0.0.0.255 area 0
!
router rip
version 2
//将OSPF重分布进RIP,并将metric值设为5。如果没有设置,metric值默认是无穷大
redistribute ospf 1 metric 5

network 24.0.0.0
no auto-summary

G、R3路由协议配置

router ospf 1
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.3 0.0.0.0 area 0
network 13.0.0.0 0.0.0.255 area 0
network 23.0.0.0 0.0.0.255 area 0

H、R4路由协议配置

router rip
version 2
network 4.0.0.0
network 14.0.0.0
network 24.0.0.0
no auto-summary

I、查看R2路由表

3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 3.3.3.1/32 [110/65] via 23.0.0.2, 00:00:44, Serial1/3
R 3.0.0.0/8 [120/6] via 24.0.0.2, 00:00:03, Serial1/2
O E2 4.0.0.0/8 [110/20] via 23.0.0.2, 00:00:44, Serial1/3
23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 23.0.0.0/24 is directly connected, Serial1/3
R 23.0.0.0/8 [120/6] via 24.0.0.2, 00:00:03, Serial1/2
24.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 24.0.0.0/24 is directly connected, Serial1/2
O E2 24.0.0.0/8 [110/20] via 23.0.0.2, 00:00:44, Serial1/3
13.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 13.0.0.0/24 [110/128] via 23.0.0.2, 00:00:44, Serial1/3
R 13.0.0.0/8 [120/6] via 24.0.0.2, 00:00:03, Serial1/2
14.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O E2 14.0.0.0/24 [110/20] via 23.0.0.2, 00:00:45, Serial1/3
R 14.0.0.0/8 [120/1] via 24.0.0.2, 00:00:04, Serial1/2

可以发现4.4.4.0/24的下一跳IP地址是23.0.0.3,这就造成R2出现非最优路径选择问题

J、修改R1和R2互相学习到AD值

因为出现次路由选择是因为R1或者R2学习到的外部路由协议AD值(RIP---120)比内部路由协议(OSPF---90)(R1、R2互相学习对方的路由)值高,所以只要将R1与R2互相学习的AD值改为121(比RIP AD大就可以)

//在R1上将从R2学习的路由AD值设为121,2.2.2.2 0.0.0.0为R2的router-id
distance 121 2.2.2.2 0.0.0.0

//在R2上将从R1学习的路由AD值设为121,1.1.1.1 0.0.0.0为R1的router-id
distance 121 1.1.1.1 0.0.0.0

需要同时在R1和R2上配置,因为R1和R2谁先学习对方的路由信息是随机的。

K、修改AD值后再查看R2的路由表

3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/65] via 23.0.0.3, 00:00:16, Serial0/0
4.0.0.0/24 is subnetted, 1 subnets
R       4.4.4.0 [120/1] via 24.0.0.4, 00:00:08, Serial0/1
23.0.0.0/24 is subnetted, 1 subnets
C       23.0.0.0 is directly connected, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
C       24.0.0.0 is directly connected, Serial0/1
13.0.0.0/24 is subnetted, 1 subnets
O       13.0.0.0 [110/128] via 23.0.0.3, 00:00:16, Serial0/0
14.0.0.0/24 is subnetted, 1 subnets
R       14.0.0.0 [120/1] via 24.0.0.4, 00:00:09, Serial0/1

问题解决了~

你可能感兴趣的:(CISCO技术文档)