Redistributing External Routes into OSPF

Problem

You want OSPF to distribute routes from another routing protocol.

Solution

The redistribute configuration command allows you to redistribute routes from another dynamic routing protocol into an OSPF process:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#router ospf 55
Router1(config-router)#redistribute eigrp 11 subnets   
Router1(config-router)#exit
Router1(config)#end
Router1#

One of the dangers when redistributing between routing protocols is that you will accidentally import more information than your routers can handle. In Version 12.3(2)T, Cisco added a feature to protect against this issue:

Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#router ospf 55
Router1(config-router)#redistribute eigrp 11 subnets   
Router1(config-router)#redistribute maximum-prefix 1000 80
Router1(config-router)#exit
Router1(config)#end
Router1#

Discussion

Redistributing external routes from another routing protocol is similar to redistributing static routes, as we did in Recipe 8.5. In the example above, all of the routes that this router learns through EIGRP process number 11 will be propagated into OSPF as Type 2 external routes. Also, as shown in the following output from the show ip protocols command, because we also included the subnets keyword, every route will be redistributed. If we had not included this keyword, OSPF would only redistribute ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.