通信人家园
标题: 双向双点重分发 [查看完整版帖子] [打印本页]
时间: 2020-5-25 16:19
作者: steftdance
标题: 双向双点重分发

基本配置:
RT1:
routerospf 1
router-id 1.1.1.1
log-adjacency-changes
network 192.168.23.0 0.0.0.255 area 0
routerrip
version 2
network 192.168.12.0
no auto-summary
RT2:
routerrip
version 2
network 192.168.10.0
network 192.168.12.0
network 192.168.14.0
no auto-summary
RT3:
routerospf 1
router-id 3.3.3.3
log-adjacency-changes
network 192.168.23.0 0.0.0.255 area 0
network 192.168.30.0 0.0.0.255 area 0
network 192.168.34.0 0.0.0.255 area 0
RT4:
routerospf 1
router-id 4.4.4.4
log-adjacency-changes
network 192.168.34.0 0.0.0.255 area 0
routerrip
version 2
network 192.168.14.0
no auto-summary
RT1、RT2、RT3、RT4:
ints0/0
ip ospf cost 1//设置开销和F口相同,以便形成负载均衡
查看RT1、RT2、RT3、RT4路由表:
RT1#show ip route
C 192.168.12.0/24 is directly connected,FastEthernet1/0
R 192.168.14.0/24 [120/1] via 192.168.12.2,00:00:04, FastEthernet1/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/2] via 192.168.23.2,00:00:41, Serial0/0
R 192.168.10.0/24 [120/1] via 192.168.12.2,00:00:04, FastEthernet1/0
C 192.168.23.0/24 is directly connected,Serial0/0
O 192.168.34.0/24 [110/2] via 192.168.23.2,00:00:41, Serial0/0
RT2#showip route
C 192.168.12.0/24 is directly connected,FastEthernet1/0
C 192.168.14.0/24 is directly connected,Serial0/0
C 192.168.10.0/24 is directly connected,Loopback0
RT3#showip route
C 192.168.30.0/24 is directly connected,Loopback0
C 192.168.23.0/24 is directly connected,Serial0/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
RT4#showip route
R 192.168.12.0/24 [120/1] via 192.168.14.2,00:00:20, Serial0/0
C 192.168.14.0/24 is directly connected,Serial0/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/2] via 192.168.34.2,00:01:39, FastEthernet1/0
R 192.168.10.0/24 [120/1] via 192.168.14.2,00:00:20, Serial0/0
O 192.168.23.0/24 [110/2] via 192.168.34.2,00:01:39, FastEthernet1/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
在RT1上将OSPF重分发进RIP
RT1:
routerrip
redistribute ospf 1 metric 3
查看RT2、RT4路由表:
RT2#show ip route
C 192.168.12.0/24 is directly connected,FastEthernet1/0
C 192.168.14.0/24 is directly connected,Serial0/0
192.168.30.0/32 is subnetted, 1 subnets
R 192.168.30.1 [120/3]via 192.168.12.1, 00:00:13, FastEthernet1/0
C 192.168.10.0/24 is directly connected,Loopback0
R 192.168.23.0/24 [120/3]via 192.168.12.1, 00:00:13, FastEthernet1/0
R 192.168.34.0/24 [120/3]via 192.168.12.1, 00:00:13, FastEthernet1/0
RT4#showip route
R 192.168.12.0/24 [120/1] via 192.168.14.2,00:00:14, Serial0/0
C 192.168.14.0/24 is directly connected,Serial0/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/2] via 192.168.34.2,00:07:21, FastEthernet1/0
R 192.168.10.0/24 [120/1] via 192.168.14.2,00:00:14, Serial0/0
O 192.168.23.0/24 [110/2] via 192.168.34.2,00:07:22, FastEthernet1/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
可知:RT2学习到了OSPF区域中的路由且路由正常;RT4路由表没有发生变化。
再在RT4上将OSPF重分发进RIP:
RT4:
routerrip
redistribute ospf 1 metric 3
查看RT2、RT4路由表:
RT2#show ip route
C 192.168.12.0/24 is directly connected,FastEthernet1/0
C 192.168.14.0/24 is directly connected,Serial0/0
192.168.30.0/32 is subnetted, 1 subnets
R 192.168.30.1 [120/3] via192.168.14.1, 00:00:03, Serial0/0
[120/3]via 192.168.12.1, 00:00:10, FastEthernet1/0
C 192.168.10.0/24 is directly connected,Loopback0
R 192.168.23.0/24 [120/3]via 192.168.14.1, 00:00:03, Serial0/0
[120/3]via 192.168.12.1, 00:00:10, FastEthernet1/0
R 192.168.34.0/24 [120/3]via 192.168.14.1, 00:00:03, Serial0/0
[120/3] via 192.168.12.1,00:00:10, FastEthernet1/0
可知:RT2上关于OSPF区域中的路由正常,形成了负载均衡。
小结:将OSPF进RIP路由表正常,没有出现问题。
在RT1上将RIP重分发进OSPF
RT1:
routerospf 1
redistribute rip metric 3 subnets
查看RT1、RT3、RT4路由表:
RT1(config-router)#do show ip ro
C 192.168.12.0/24 is directly connected,FastEthernet1/0
R 192.168.14.0/24 [120/1] via 192.168.12.2,00:00:07, FastEthernet1/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/65] via 192.168.23.2,00:02:24, Serial0/0
R 192.168.10.0/24 [120/1] via 192.168.12.2,00:00:07, FastEthernet1/0
C 192.168.23.0/24 is directly connected,Serial0/0
O 192.168.34.0/24 [110/65] via 192.168.23.2,00:02:24, Serial0/0
RT3#showip route
O E2192.168.12.0/24 [110/3] via 192.168.23.1, 00:00:15, Serial0/0
O E2192.168.14.0/24 [110/3] via 192.168.23.1, 00:00:15, Serial0/0
C 192.168.30.0/24 is directly connected,Loopback0
O E2192.168.10.0/24 [110/3] via 192.168.23.1, 00:00:15, Serial0/0
C 192.168.23.0/24 is directly connected,Serial0/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
RT4(config-router)#doshow ip route
O E2 192.168.12.0/24 [110/3] via 192.168.34.2, 00:01:00,FastEthernet1/0
C 192.168.14.0/24 is directly connected,Serial0/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/2] via 192.168.34.2,00:01:00, FastEthernet1/0
O E2 192.168.10.0/24 [110/3] via 192.168.34.2, 00:01:00,FastEthernet1/0
O 192.168.23.0/24 [110/2] via 192.168.34.2,00:01:00, FastEthernet1/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
可知:RT1路由表没有变化;RT3学习到了RIP区域的路由,且单点重分发RIP进OSPF时路由正常;RT4出现了次佳路径,192.168.10.0/24、192.168.12.0/24网段的下一跳变为了RT3。
再在RT4:上将RIP重分发进OSPF
RT4:
routerospf 1
redistribute rip metric 3 subnets
查看RT1、RT3、RT4路由表:
RT1(config-router)#do show ip ro
C 192.168.12.0/24 is directly connected,FastEthernet1/0
O E2 192.168.14.0/24 [110/3] via 192.168.23.2, 00:00:13, Serial0/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/2] via 192.168.23.2,00:00:13, Serial0/0
R 192.168.10.0/24 [120/1] via 192.168.12.2,00:00:23, FastEthernet1/0
C 192.168.23.0/24 is directly connected,Serial0/0
O 192.168.34.0/24 [110/2] via 192.168.23.2,00:00:13, Serial0/0
RT3#showip route
O E2 192.168.12.0/24 [110/3] via 192.168.23.1, 00:00:47, Serial0/0
O E2 192.168.14.0/24 [110/3] via 192.168.34.1, 00:00:47,FastEthernet1/0
C 192.168.30.0/24 is directly connected, Loopback0
O E2 192.168.14.0/24 [110/3] via 192.168.23.1, 00:00:47, Serial0/0
C 192.168.23.0/24 is directly connected,Serial0/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
RT4(config-router)#doshow ip ro
O E2192.168.12.0/24 [110/3] via 192.168.34.2, 00:01:35, FastEthernet1/0
C 192.168.14.0/24 is directly connected,Serial0/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/2] via 192.168.34.2,00:01:35, FastEthernet1/0
O E2192.168.10.0/24 [110/3] via 192.168.34.2, 00:01:35, FastEthernet1/0
O 192.168.23.0/24 [110/2] via 192.168.34.2,00:01:35, FastEthernet1/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
可知:RT1出现了次佳路径,192.168.10.0/24网段的下一跳变为了RT3;RT3学习到了RIP区域的路由,但路由不正常,双点重分发RIP进OSPF时RIP区域的路由没有形成负载均衡;RT4路由表较上次没有变化,依然存在次佳路径。
小结:
RIP重分发进OSPF时,OSPF的ASBR的路由表会出现次佳路径,因OSPF的AD(110)值小于RIP(120)的AD值,故当进行重分发后,会选择OSPF路由放到全局路由表中,形成了次佳路径,
而其他路由器在双点重分发时关于RIP的路由没有形成负载均衡的原因,因其中一台ASBR中的RIP路由已变成了OSPF路由,重分发时不会将该路由再进行重分发。
上例的RT3的RIP路由没有形成负载均衡即是因为RT4重分发后,192.168.10.0/24、192.168.12.0/24没有进行重分发。RT1的192.168.14.0/24也没有进行重分发。
解决方法:
修改OSPF外部AD值,使其大于RIP的AD值。
配置:
RT1、RT4:
routerospf 1
distance ospf external 130
查看RT1、RT3、RT4路由表:
RT3#show ip route
O E2 192.168.12.0/24 [110/3] via 192.168.34.1, 00:00:21,FastEthernet1/0
[110/3] via 192.168.23.1,00:00:21, Serial0/0
O E2 192.168.14.0/24 [110/3] via 192.168.34.1, 00:00:36,FastEthernet1/0
[110/3]via 192.168.23.1, 00:00:36, Serial0/0
C 192.168.30.0/24 is directly connected,Loopback0
O E2 192.168.10.0/24 [110/3] via 192.168.34.1, 00:00:36,FastEthernet1/0
[110/3]via 192.168.23.1, 00:00:36, Serial0/0
C 192.168.23.0/24 is directly connected,Serial0/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
RT1(config-router)#doshow ip ro
C 192.168.12.0/24 is directly connected,FastEthernet1/0
R 192.168.14.0/24 [120/1]via 192.168.12.2, 00:00:22, FastEthernet1/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/2] via 192.168.23.2,00:01:36, Serial0/0
R 192.168.10.0/24 [120/1]via 192.168.12.2, 00:00:22, FastEthernet1/0
C 192.168.23.0/24 is directly connected,Serial0/0
O 192.168.34.0/24 [110/2] via 192.168.23.2,00:01:36, Serial0/0
RT4(config-router)#doshow ip ro
R 192.168.12.0/24 [120/1]via 192.168.14.2, 00:00:04, Serial0/0
C 192.168.14.0/24 is directly connected,Serial0/0
192.168.30.0/32 is subnetted, 1 subnets
O 192.168.30.1 [110/2] via 192.168.34.2,00:01:14, FastEthernet1/0
R 192.168.10.0/24 [120/1]via 192.168.14.2, 00:00:04, Serial0/0
O 192.168.23.0/24 [110/2] via 192.168.34.2,00:01:14, FastEthernet1/0
C 192.168.34.0/24 is directly connected,FastEthernet1/0
可知:RT3关于RIP区域的路由形成负载均衡,RT1、RT4也没有出现次佳路径,问题已解决。
总结:
双点双向重分发时,需要注意两边路由协议进入全局路由表的优先级即AD值,AD值小的重分发进AD值大的不会出现问题,对于AD值大的重分发进AD值小的情况,应修改AD值,使其不会出现次佳路径等问题。还需注意的是:外部AD值、内部AD值,以及重分发的顺序问题。
通信人家园 (https://www.txrjy.com/) |
Powered by C114 |