OSPF Default External Route Cost Calculation

H12-821 By islever Editorial Last updated

OSPF Basics OSPF Route Calculation

Short answer

A The cost is 1 because OSPF redistributes routes as Type 2 (E2) by default, displaying only the external cost.

Question

On the campus OSPF network shown in the following figure, the interfaces connecting the five routers are GE interfaces, and their costs are not changed. The import-route command is run on RI. After the network converges, the route to the server at 192.168.1.0/24 is queried on R4. Which of the following is the cost of this route?
Exhibit: OSPF Default External Route Cost Calculation
  1. 1 Correct Answer
  2. 2
  3. 3
  4. 4

Key Takeaways

OSPF external routes are Type 2 (E2) by default, meaning their cost is fixed to the external metric (usually 1) and ignores internal path costs.

Learn why OSPF external routes show a cost of 1 by default. This guide explains the difference between Type 1 and Type 2 external routes in Huawei H12-821 exams.

Common mistake: Choosing 3 or 4 by incorrectly adding the internal hop counts from R1 to R4. This mistake applies E1 logic to a default E2 route.

Expert Analysis

The question asks for the cost of a route to 192.168.1.0/24 on router R4, where the network has converged after an import-route command is executed on R1. In OSPF, when a route is imported (redistributed) into the OSPF domain, it becomes an External Route (Type 5 or Type 7 LSA).

A key characteristic of OSPF external routes is that they are divided into two types based on how cost is calculated:

  1. Type 1 (E1): Cost = External Cost + Internal Path Cost.
  2. Type 2 (E2): Cost = External Cost only. The internal path cost is ignored unless there are multiple paths with equal external costs.

By default, the Huawei VRP implementation sets redistributed routes as Type 2 (E2). For E2 routes, the cost displayed in the routing table is the external metric assigned at the time of redistribution (the ASBR's configuration), regardless of the internal hop count or link costs within the OSPF area.

Since the question states that import-route was run without specifying any specific cost type or value, and assuming standard default behavior for such exam scenarios where no external cost is explicitly mentioned as being high or changed, the default external cost is typically 1. Therefore, the cost shown for this route on R4 will be the default external cost, which is 1.

Option A (1) represents this default external cost. Options B, C, and D would imply either E1 calculation (adding internal hops) or non-default external costs, neither of which apply under the default E2 assumption.

Official Reference

Exam Strategy

When you see 'import-route' or 'redistribute' in OSPF questions, immediately check if the question specifies a Type 1 or Type 2 metric. If it doesn't, assume Type 2 (E2). For E2 routes, the answer is almost always the default external cost (1) or the explicitly stated external cost, not the sum of internal links.

Frequently Asked Questions

What is the default external cost in OSPF?

The default external cost for redistributed routes in OSPF is typically 1.

How do I calculate cost for OSPF Type 1 routes?

For Type 1 (E1) routes, add the external metric to the internal cost of the path to the ASBR.

More H12-821 FAQ →

Discussion 1 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 1

  1. HCIP Resolutor 👍 1 Answered B
    Por definición en OSPF, para una ruta Tipo 2, el costo mostrado en la tabla de enrutamiento solo considera el costo externo asignado al momento de la redistribución, ignorando el costo interno del camino hasta el ASBR.

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All H12-821 Questions

Access 168 questions with complete answers and detailed explanations.

View Full H12-821 Practice Test →

← Back to H12-821 Study Guide