What are E1 and E2 Routes? OSPF External Routes

Rashmi Bhardwaj | Blog,Routing & Switching
Google ADs

Introduction to OSPF External Routes

An OSPF external route is a route that is imported into the OSPF domain from another routing protocol or from static routes. These routes are advertised within the OSPF network as external routes.

An external route (redistributed from another routing protocol, static route or connected route) will be tagged as a Type 5 LSA (E route). This LSA is circulated throughout the OSPF domain except for Stub, Totally Stubby and Not-so-stubby areas.

External routes are propagated through an OSPF area as a type 5 from an ASBR, or type 7 LSA from an ASBR in an NSSA. These routes from outside the OSPF domain, can either be E1 or E2 routes and they are treated in slightly different ways. In this article we will discuss the difference E1 and E2 routes.

Google ADs

E1 or External Type 1 Routes 

The cost of E1 routes is the cost of the external metric with the addition of the internal cost within OSPF to reach that network.

E2 or External Type 2 Routes 

The cost of E2 routes will always be the external metric, the metric will takes no notice of the internal cost to reach that network.

If 2 external type 2 routes exist with the same metric to the same destination the route with the lowest metric to the ASBR will is used. Also if an E1 and E2 route exist to the same destination the E1 route will always be preferred irrespective of the metric.

Related- OSPF N1 and N2 Routes

Comparison: OSPF E1 and E2 Routes

Basically the difference between E1 and E2 external routes is:

E1 includes – the internal cost to ASBR added to the external cost,

E2 does not include – internal cost. it is same as external cost.

Below Diagram will help in understanding how OSPF E1 and E2 external routes are calculated external routes within the OSPF domain:

OSPF E1 VS E2

Related – OSPF Cost Calculation

Network 10.1.1.0/24 will be redistributed on R3 into OSPF domain with seed metric (cost) of 20. This holds true for both E1 and E2 routes.

Now, when R2 needs to calculate metric/cost to network 10.1.1.0/24, E1 and E2 route cost computation will be different as illustrated:

For E1 Route Cost 

R2 will calculate the metric or cost between R2 and R3 and add to the seed cost advertised by R3. Hence, in this case, E1 cost for R2 shall be = Cost from R2 to R3 + Seed cost = 1 + 20 = 21.

For E2 Route Cost 

R2 will calculate the metric or cost to reach network 10.1.1.0/24 by only considering the seed cost and will not add R2-R3 path cost. Hence, in this case, E2 cost will be = Seed cost = 20.

In the same way, R1 will calculate E1 and E2 cost for Network 10.1.1.0/24 as –

For E1 Route cost = 1+1+20 = 22
For E2 Route Cost = 20

Q.1 How is the metric calculated for OSPF Type 1 and Type 2 external routes?

    Type 1 (E1): Metric = OSPF cost to reach the ASBR + External cost.
    Type 2 (E2): Metric = External cost only.

    Q.2 What is an ASBR in OSPF?

      An ASBR (Autonomous System Boundary Router) is a router that connects an OSPF autonomous system (AS) to an external network, importing external routes into the OSPF domain.

      Q.3 How do OSPF external routes propagate within the OSPF network?

        OSPF external routes are propagated by ASBRs using Type 5 or Type 7 LSAs (Link-State Advertisements). Type 5 LSAs are used in standard areas, while Type 7 LSAs are used in NSSAs (Not-So-Stubby Areas).

        Q.4 What is the difference between Type 5 and Type 7 LSAs?

          • Type 5 LSA is used to advertise external routes in standard OSPF areas.
          • Type 7 LSA is used to advertise external routes in NSSAs. These Type 7 LSAs are converted to Type 5 LSAs by the ABR (Area Border Router) when they cross into other areas.

          Q.5 Can OSPF external routes be summarized?

            Yes, OSPF allows summarization of external routes at the ASBR. This can reduce the number of LSAs and improve OSPF performance.

            Q.6 What is the default metric for OSPF external routes?

              The default metric for OSPF external routes can vary based on the implementation, but often it is set to a value of 20 for Type 2 (E2) routes. This default can be modified during route redistribution.

              Q.7 How do you configure OSPF to import external routes?

                External routes can be imported into OSPF using the redistribute command in the OSPF router configuration mode. For example:

                router ospf 1
                redistribute static subnets

                Q.8 What is the role of the forwarding address in OSPF external routes?

                  The forwarding address is an IP address included in the Type 5 LSA that specifies a better next-hop address for reaching the external destination. If the forwarding address is 0.0.0.0, the ASBR itself is the next hop.

                  Q.9 Can you prevent certain routes from being redistributed into OSPF?

                    Yes, route filtering can be applied during redistribution to prevent specific routes from being imported into OSPF. This can be done using route maps, prefix lists, or access lists.

                    Q.10 How does OSPF handle external route preference?

                      OSPF prefers Type 1 (E1) external routes over Type 2 (E2) routes if both exist for the same destination. If there are multiple routes of the same type, the route with the lowest metric is preferred.

                      Are you preparing for your next interview?

                      Please check our e-store for e-book on OSPF Interview Q&A. All the e-books are in easy to understand PDF Format, explained with relevant Diagrams (where required) for better ease of understanding.

                      ABOUT THE AUTHOR


                      Leave a Comment

                      Your email address will not be published. Required fields are marked *

                      Shopping Cart