OSPF Routing Policy Overview
All routing protocols store their routing information in the routing table. The routing table uses this collected route information to determine the active routes to destinations. The routing table then installs the active routes into its forwarding table and also exports them back into the routing protocols. It is these exported routes that the protocols advertise.
OSPF has a set of default rules that determine which routes it places in the routing table and advertises from the routing table. The default rules for all routing protocols are known as the default routing policy. The default routing policy is always present. You can further control which routes the protocol stores in the routing table and which routes the routing table exports into the protocol by defining a routing policy for that protocol. A routing policy has a major impact on the flow of routing information or packets within or through the device. The match conditions and actions allow you to configure a customized policy to fit your needs. A user-defined routing policy preempts the default routing policy.
To create a routing policy, you must define the policy and apply it. You define the policy by specifying the criteria that a route must match and the actions to perform if a match occurs. You then apply the policy to OSPF.
Default OSPF Routing Policy
OSPF is a link-state protocol that exchanges routes between systems within an autonomous system (AS). All devices within an AS must share the same link-state database, which includes routes to reachable prefixes and the metrics associated with the prefixes. The default import policy for OSPF is to accept all learned routes and import them into the routing table. The default export policy for OSPF is to reject everything. OSPF does not actually export its internally learned routes (the directly connected routes on interfaces that are running the protocol). OSPF uses link-state advertisement (LSA) flooding to advertise both local routes and learned routes, and LSA flooding is not affected by the export policy.