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

18

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.

Other related questions:
What route selection rules should be followed when external routes with the same prefix are imported into OSPF on an S series switch
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.

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.

  • What are the rules for selecting routes belonging to different OSPF processes
    OSPF supports multi-processes. Multiple OSPF processes can run on the same router independently. Assume that a router is configured with two OSPF processes: process 1 and process 2. They are independent of each other. Therefore, both of the routes belonging to process 1 and process 2 are advertised to the routing management (RM) module. Route selection between the two processes complies with the following rules: 1. The RM module checks the protocol preference of process 1 and process 2. The route belonging to the process with higher protocol preference is selected as the optimal route. NOTE: To set the preference of an OSPF route in the specified process, run the preference [ ase ] { preference | route-policy route-policy-name } * command. The default preference of an OSPF route is 10. When an ASE is specified, the default value is 150. 2. When the protocol preferences of the two processes are the same, the RM module compare the cost of the two routes. The route with smaller cost value is selected as the optimal route. NOTE: When selecting the optimal route, the RM module first compares the protocol preference. The RM module compares the cost of routes only when the protocol preferences are the same.

    USG2000 / 5000 Configure OSPF to import external routes
    USG2000 & 5000 Configure OSPF to import external routes as follows: 1. Configure the basic parameters of each interface to implement interworking. 2. Configure OSPF on the USG. 3. Configure the OSPF area on the USG and add the Internet segment on the USG to the OSPF area. 4. Configure OSPF to import direct routes on the egress gateway.

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