拓扑:

基本配置完成之后,我们在R4将RIP重发布进OSPF,这样R1,R2就可以学到外部路由了。
R4:
router ospf 10
log-adjacency-changes
redistribute rip subnets
network 10.1.1.0 0.0.0.255 area 0
network 24.1.1.0 0.0.0.255 area 0
router rip
version 2
passive-interface Loopback0
network 4.0.0.0
network 45.0.0.0
no auto-summary
R3:
router ospf 10
router-id 3.3.3.3
log-adjacency-changes
passive-interface Loopback0
network 13.1.1.0 0.0.0.255 area 0
!
router rip
version 2
passive-interface Loopback0
network 3.0.0.0
network 35.0.0.0
no auto-summary
!
那么,这种重发布会打来什么问题呢?
看看R3的路由表就知道了。
R3#sh ip rou
Codes: 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
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
O
1.1.1.0 [110/65] via 13.1.1.1, 00:12:30, Serial1/1
35.0.0.0/24 is subnetted, 1 subnets
C
35.1.1.0 is directly connected, Serial1/2
2.0.0.0/24 is subnetted, 1 subnets
O
2.2.2.0 [110/129] via 13.1.1.1, 00:12:30, Serial1/1
3.0.0.0/24 is subnetted, 1 subnets
C
3.3.3.0 is directly connected, Loopback0
4.0.0.0/24 is subnetted, 1 subnets
O E2
4.4.4.0 [110/20] via 13.1.1.1, 00:12:30, Serial1/1
5.0.0.0/24 is subnetted, 1 subnets
O E2
5.5.5.0 [110/20] via 13.1.1.1, 00:12:30, Serial1/1
24.0.0.0/24 is subnetted, 1 subnets
O
24.1.1.0 [110/129] via 13.1.1.1, 00:12:31, Serial1/1
10.0.0.0/24 is subnetted, 1 subnets
O
10.1.1.0 [110/65] via 13.1.1.1, 00:12:31, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
O
12.1.1.0 [110/128] via 13.1.1.1, 00:12:31, Serial1/1
13.0.0.0/24 is subnetted, 1 subnets
C
13.1.1.0 is directly connected, Serial1/1
45.0.0.0/24 is subnetted, 1 subnets
O E2
45.1.1.0 [110/20] via 13.1.1.1, 00:12:31, Serial1/1
上面红色的字段标识的路由条目是作为外部路由冲R4学到的。这几条路由本来可以通过RIP学习到,但是现在被OSPF外部路由覆盖了。因为OSPF外部路由的优先级是110,比RIP的路由及120要高。
这也算是一个比较特殊的地方吧,如果是OSPF往RIP里重发布就不会有这种情况,因为RIP没有外部路由的概念,如果是ISIS和RIP之间,也会出现同样的情况,因为ISIS也没有什么外部路由的概念,他的重发布进来的RIP路由,也会覆盖掉本区域内其他运行了RIP路由协议的路由器。
另外还有一个比较重要的地方就是,默认情况下重发布进来的外部路由的开销值都是20,而且不会因为在OSPF区域里经历了多个路由就累加开销值。但是路由器并不会因此而进行等价负载均衡,因为OSPF对于外部路由的选择其实就是对ABR。怎么样到达ABR近,就选哪条路。
本文出自 “海阔天空” 博客,转载请与作者联系!