Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Default route restirction in OSPF

Hi

I have originated the default route in OSPF but i want it to limit the propogation of same to one router only. For same I have configured the route-map & matched the access-list with loopback ip address of the router.

But I observered the another router with loopback ip address 10.100.100.2 also receiving the default router. Is there any misconfiguration in below config.

router ospf 100

default-information originate route-map Default_Route

R1#sh route-map Default_Route
route-map Default_Route, permit, sequence 10
  Match clauses:
    ip address (access-lists): default_route
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes

R1#sh access-lists default_route
Standard IP access list default_route
    10 permit 10.100.100.1 (38036 matches)

regards,

Nilesh

1 REPLY
Cisco Employee

Re: Default route restirction in OSPF

Hello Nilesh,

You cannot limit a propagation of the default route in the OSPF in the way you did. The route-map construct used with the default-originate command is used only to modify some parameters (attributes) of how the default route is injected into OSPF but once it has been injected into it, the originating router has no further influence where it will be spread and which routers will learn it.

If you need to configure a router to not install an OSPF-learned route in the routing table, you can configure it as follows:

ip prefix-list AllowedOSPFRoutes deny 0.0.0.0/0

ip prefix-list AllowedOSPFRoutes permit 0.0.0.0/0 le 32

router ospf 1

distribute-list prefix AllowedOSPFRoutes in

The prefix-list AllowedOSPFRoutes denies the default route and allows all other routes learned from OSPF to be inserted into the routing table. This configuration has to be applied on all OSPF routers that should not learn the default route via OSPF because for OSPF, this kind of route filtering has effect only on the router where it is configured, and does not influence other routers.

If you, however, need to install the OSPF-learned default route only on a single router and all other routers shall not learn it then there is a question whether is it actually appropriate to use the OSPF to distribute the default route information. You could use a static route on the single router (if a static routing is fine), or use the IP SLA to dynamically install/remove the default route basing on some active test.

Best regards,

Peter

5412
Views
10
Helpful
1
Replies