What route selection rules should be followed when external routes with the same prefix are imported into OSPF on an S series switch

2

Question: What route selection rules should be followed when external routes with the same prefix are imported into an S series switch supporting OSPF?

Answer: Imported external OSPF routes include Type 1 and Type 2 routes. By default, Type 2 routes are imported.
When Type 1 external routes are imported, in route calculation, the cost of the route to be advertised is the sum of the LSA cost and the cost of an external route.
When Type 2 external routes are imported, OSPF considers that the cost of an external route is much higher than that of an intra-area route. Therefore, only the LSA cost value is used in route calculation.
When Type 1 external routes with the same prefix are imported, the route selection rules are as follows:
The route with the lowest cost is selected. The cost is the sum of the cost of the route to the ASBR and the LSA cost.
If the costs of the routes are the same, the route in a Type 5 LSA is selected.
When Type 2 external routes with the same prefix are imported, the route selection rules are as follows:
The imported route with the smallest LSA cost value is selected.
If the LSA cost values are the same, the route with the lowest cost of the route to the ASBR is selected.
If the costs of the routes are the same, the route in a Type 5 LSA is selected.

Other related questions:
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.

Precedence of external routes imported by OSPF on S series switches
When an S series switch runs OSPF, you can run the import-route command in the OSPF process view to import external routes. The routes imported using this method are OSPF ASE routes and default precedence is 150.

What are rules for route selection
  • Rule 1: The route with higher priority is preferred. A small value indicates a high priority. If a route cannot be selected using this rule, go to rule 2.
  • Rule 2: If two routes have the same priority, the route with the higher internal protocol preference is preferred. A small value indicates a high priority. If a route cannot be selected using this rule, go to rule 3.
  • Rule 3: If two routes have the same priority and belong to the same protocol, the route with the lower-cost value is preferred. If the cost values of two routes are the same, load balancing can be formed. If the number of routes for forming load balancing exceeds the maximum value (such as m) set by the system, the total number of only the first m routes act as the active routes.

  • External routes imported using OSPF on a CE series switch cannot be viewed in the routing table
    This problem is caused by routing loop detection. By default, routing loop detection is enabled on a CE series switch. When OSPF VPN multi-instance is deployed on a Multi-VPN-Instance CE (MCE) device, and DN Bit is set in Type 3, Type 5, or Type 7 LSAs, corresponding routes cannot be calculated and viewed in the routing table because routing loop detection is performed during OSPF route calculation. To address this problem, run the vpn-instance-capability simple command on the MCE device to disable routing loop detection of the OSPF instance.

    If you have more questions, you can seek help from following ways:
    To iKnow To Live Chat
    Scroll to top