Course menu

Course 9: OSPFLesson 6.3 (19 of 20 in this course)88 of 118 in the CCNA series

Beyond CCNA (optional). This topic is not on the CCNA 200-301 exam. It is useful at work and in later study; skip it if you are preparing for the exam. (Redistribution and external LSAs are not in the single-area OSPFv2 objective (3.4).)

External routes: LSA types 4 and 5, E1 and E2

Redistribution into OSPF, how type 5 and type 4 LSAs work together, and how E1 and E2 metrics are calculated and compared.

Advanced · 11 min read

What you will learn

After this lesson, you can redistribute routes into OSPF, explain how type 5 and type 4 LSAs work together across areas, and calculate E1 and E2 metrics.

  • Redistribution
  • Type 4 / Type 5
  • E1 vs E2

An OSPF external route is a route that came from outside OSPF (static, connected, EIGRP, BGP…) and was redistributed into it by an ASBR. It is carried in a type 5 LSA that is flooded through every normal area, and shown as O E1 or O E2.

In simple terms: A route OSPF didn't discover itself. A border router learned it elsewhere and passed it on, with a note saying "ask me for this one".

A real-life situation

The company connects to a partner that runs EIGRP and owns 10.50.0.0/16. R5 speaks both protocols. Users everywhere need to reach the partner, but OSPF routers only know OSPF routes. R5 must redistribute the partner's routes into OSPF, and every router, in every area, has to work out both the route and how to reach R5.

What external routes are

area 1area 0area 0area 2LAN 1172.16.1.0/24R1RID 1.1.1.1R2 (ABR)RID 2.2.2.2R3RID 3.3.3.3R4 (ABR)RID 4.4.4.4R5 (ASBR)RID 5.5.5.5Partner (EIGRP)10.50.0.0/16
  1. 1. R5 learns 10.50.0.0/16 from the partner R5 runs EIGRP towards the partner and redistributes those routes into OSPF. That makes R5 an ASBR.
  2. 2. R5's type 5 LSA is flooded everywhere Unchanged through areas 2, 0 and 1. It says: 10.50.0.0/16, metric 20, type E2, advertised by 5.5.5.5.
  3. 3. R4 tells area 0 where R5 is Area 0 has no type 1 LSA for R5, so R4 creates a type 4: ASBR 5.5.5.5 is reachable through me.
  4. 4. R2 does the same for area 1 R2 creates its own type 4 into area 1, with its cost to reach R5. Now R1 can complete the route.

Why it works this way

External prefixes can be numerous (a full partner network, or thousands of BGP routes), so OSPF floods each one once, unchanged, as a type 5 LSA. It doesn't rewrite them at every ABR the way type 3 summaries are rewritten. That leaves one question for routers in other areas: where is the ASBR? The type 4 LSA answers it with the ABR's cost to the ASBR, so each router can add its own cost to the ABR.

E2 and E1

TypeMetric shownR1's metric for 10.50.0.0/16 (seed 20)
E2 (default)The seed metric only20
E1Seed metric + internal cost to the ASBR20 + 4 = 24 (R1 → R2 → R3 → R4 → R5)

With E2, routers still know the internal cost to the ASBR (the forward metric) and use it to choose between two E2 routes with the same seed metric, for example from two ASBRs.

Which route type wins

For the same prefix, OSPF prefers, in order:

  1. intra-area (O),
  2. inter-area (O IA),
  3. external type 1 (O E1, or O N1 in an NSSA),
  4. external type 2 (O E2, or O N2).

Only within the same type does the lower metric decide.

How to configure it on Cisco IOS

router ospf 1 redistribute eigrp 100 subnets

On R5. Every EIGRP route becomes a type 5 LSA with the default seed metric 20 and type E2.

router ospf 1 redistribute eigrp 100 subnets metric 50 metric-type 1

Seed metric 50 and type E1, so each router adds its own cost to reach R5.

router ospf 1 summary-address 10.50.0.0 255.255.0.0

On the ASBR: advertise one type 5 LSA for the whole range instead of one per redistributed subnet. (area range is the ABR equivalent for internal routes.)

💡 Redistributing in both directions (OSPF into EIGRP and EIGRP into OSPF) on more than one router can create routing loops. Real networks use route maps and tags to control it; that is CCNP material.

How to verify it

Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ip ospf database
            OSPF Router with ID (1.1.1.1) (Process ID 1)

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         802         0x80000006 0x00A3F1 6
2.2.2.2         2.2.2.2         795         0x80000004 0x0051C2 2

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.23.0       2.2.2.2         790         0x80000001 0x00E21B
10.0.34.0       2.2.2.2         790         0x80000001 0x00D93A
10.2.45.0       2.2.2.2         790         0x80000001 0x0077C5

                Summary ASB Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
5.5.5.5         2.2.2.2         512         0x80000001 0x00F06D

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
10.50.0.0       5.5.5.5         515         0x80000001 0x00B8D4 0
Summary ASB Link States are type 4: from R2, naming ASBR 5.5.5.5. Type-5 AS External Link States come from 5.5.5.5 itself, unchanged. (Checksums are illustrative.)
Example output · based on Cisco documentation; exact format varies by platform and software version
R1#show ip route ospf | include 10.50
O E2     10.50.0.0/16 [110/20] via 10.1.12.2, 00:08:35, GigabitEthernet0/1
Metric 20 on R1 although R5 is four routers away: E2 doesn't add internal cost. With metric-type 1 it would read O E1 10.50.0.0/16 [110/24].
show ip ospf border-routers

On R1: lists R2 as an ABR and 5.5.5.5 as an ASBR reachable through 10.1.12.2.

What goes wrong and how to troubleshoot it

  • The ASBR has the routes but OSPF doesn't advertise them. No redistribute, or (on old IOS) no subnets, so only classful networks went across.
  • External routes reach some areas but not one. That area is a stub or totally stubby area, which blocks type 5 LSAs by design.
  • Traffic uses a far exit. Two ASBRs advertise the same prefix as E2 with different seed metrics, so internal distance is ignored. Use E1, or equal seed metrics.

Common mistakes

  • Expecting type 4 LSAs in the ASBR's own area. They are only needed in other areas.
  • Thinking E2 routes ignore distance completely; the forward metric still breaks ties.
  • Comparing an E1 and an O IA route by metric. The route type decides first.

Key takeaways

✅ Key takeaways
  • An ASBR redistributes outside routes as type 5 LSAs, flooded unchanged to every normal area.
  • ABRs create type 4 LSAs so routers in other areas can reach the ASBR.
  • E2 (default, seed 20 for redistributed routes) keeps the seed metric; E1 adds internal cost.
  • Preference: O, then O IA, then E1/N1, then E2/N2.

Check yourself

Predict · scenario 1

Which router creates the type 4 LSA that R1 uses to find R5?

Predict · scenario 2

R5 redistributes with metric-type 1 and seed 20. R1's cost to R5 is 4. What does R1 show?

Predict · scenario 3

A router has O IA 10.50.1.0/24 [110/80] and O E1 10.50.1.0/24 [110/30] for the same prefix. Which is installed?

FAQ

Why does OSPF prefer an internal route over an external one with a lower metric?
OSPF compares route types before metrics: intra-area, then inter-area, then E1, then E2. A route learned inside OSPF is trusted more than one injected from outside, whatever the numbers say.
Do I still need the subnets keyword?
On older IOS releases, redistribute without subnets only took classful networks, so subnets was almost always needed. Recent releases add it automatically. Adding it does no harm.
Why is the type 4 LSA needed at all?
A type 5 LSA names its ASBR by router ID. Routers in the ASBR's own area find it through its type 1 LSA. Routers in other areas don't have that LSA, so the ABR creates a type 4 saying "the ASBR 5.5.5.5 is reachable through me at this cost".