Skip to Content
Cisco IOS Cookbook, 2nd Edition
book

Cisco IOS Cookbook, 2nd Edition

by Kevin Dooley, Ian Brown
December 2006
Intermediate to advanced
1188 pages
72h 8m
English
O'Reilly Media, Inc.
Content preview from Cisco IOS Cookbook, 2nd Edition

Redistributing Static Routes into OSPF

Problem

You want OSPF to propagate one or more static routes.

Solution

To redistribute static routes into an OSPF process, use the redistribute static configuration command:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#ip route 192.168.10.0 255.255.255.0 172.22.1.4
Router1(config)#ip route 172.24.1.0 255.255.255.0 172.22.1.4
Router1(config)#ip route 10.100.1.0 255.255.255.0 172.22.1.4
Router1(config)#router ospf 55
Router1(config-router)#redistribute static     
% Only classful networks will be redistributed
Router1(config-router)#exit
Router1(config)#end
Router1#

Discussion

As the warning message indicates, OSPF will only redistribute classful network routes by default. In the example, we included three static routes. Of these routes, only 192.168.10.0/24 is classful. If we then look at the routing table on a different router, we can see that the other two routes are not present:

Router5#show ip route ospf O E2 192.168.10.0/24 [110/20] via 172.25.1.5, 00:02:49, Ethernet0 172.16.0.0/24 is subnetted, 1 subnets O 172.16.2.0 [110/20] via 172.25.1.5, 00:02:49, Ethernet0 172.20.0.0/16 is variably subnetted, 3 subnets, 3 masks O IA 172.20.10.0/24 [110/1582] via 172.25.1.5, 00:02:49, Ethernet0 O IA 172.20.1.0/30 [110/1572] via 172.25.1.5, 00:02:49, Ethernet0 O IA 172.20.100.1/32 [110/1573] via 172.25.1.5, 00:02:49, Ethernet0 172.22.0.0/24 is subnetted, 1 subnets O 172.22.1.0 [110/20] via 172.25.1.5, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

IP Routing on Cisco IOS, IOS XE, and IOS XR: An Essential Guide to Understanding and Implementing IP Routing Protocols

Brad Edgeworth, Aaron Foss, Ramiro Garza Rios
Cisco Software-Defined Access

Cisco Software-Defined Access

Srilatha Vemula, Jason Gooley, Roddie Hasan

Publisher Resources

ISBN: 0596527225Supplemental ContentErrata Page