What are route selection rules if OSPF imports external routes with the same prefix

OSPF can import Type 1 and Type 2 external routes. By default, OSPF imports Type 2 external routes.

If a Type 1 external route is imported, the cost contained in the corresponding LSA and the cost of the Type 1 external route are used for route calculation.

If a Type 2 external route is imported, the cost of the Type 2 external route is much larger than the cost of an OSPF internal route. Therefore, only the cost of the corresponding LSA is used for route calculation.

Route selection rules are described below if OSPF imports Type 1 external routes with the same prefix:
Costs (cost of a route to the ASBR+cost contained in the corresponding LSA) of the imported routes are compared. The route with a smaller cost is preferred.
If the route costs are the same, the corresponding LSA types are compared. The route that is imported using a Type 5 LSA is preferred.
Route selection rules are described below if OSPF imports Type 2 external routes with the same prefix:
The costs contained in the LSAs that are used to import the routes are compared. The route that is imported using the LSA with a smaller cost is preferred.
If the costs in LSAs are the same, the costs of the routes to the ASBR are compared. The route with a smaller cost is preferred.
If the costs of the routes to the ASBR are the same, the corresponding LSA types are compared. The route that is imported using a Type 5 LSA is preferred.

Scroll to top