To enable or disable the exporting of BGP (Border Gateway Protocol), RIP (Routing Information Protocol), static, and direct (interface) routes to OSPF (Open Shortest Path First), use the following commands:
enable ospf export [bgp | direct | e-bgp | i-bgp | rip | static | isis | isis-level-1 | isis-level-1-external | isis-level-2 | isis-level-2-external | host-mobility] [cost cost type [ase-type-1 | ase-type-2] {tag number} | policy-map]
disable ospf export [bgp | direct | host-mobility |e-bgp | i-bgp | rip | static | isis | isis-level-1| isis-level-1-external | isis-level-2 | isis-level-2-external]
These commands enable or disable the exporting of RIP, static, and direct routes by way of LSA to other OSPF routers as AS-external type 1 or type 2 routes. The default setting is disabled.
The cost metric is inserted for all Border Gateway Protocol (BGP), RIP, static, and direct routes injected into OSPF. If the cost metric is set to 0, the cost is inserted from the route. For example, in the case of BGP export, the cost equals the multiple exit discriminator (MED) or the path length. The tag value is used only by special routing applications. Use 0 if you do not have specific requirements for using a tag. (The tag value in this instance has no relationship with IEEE 802.1Q VLAN (Virtual LAN) tagging.)
The same cost, type, and tag values can be inserted for all the export routes, or policies can be used for selective insertion. When a policy is associated with the export command, the policy is applied on every exported route.
The exported routes can also be filtered using policies.
Note
For routes exported to OSPF via a policy file, any refresh applied on that policy may result in temporary withdrawal and then immediate readvertising of those routes.Verify the configuration using the command show ospf.