Default Route Redistribution into OSPF
In most enterprise and branch networks, internal routers do not need to know every route on the internet — they only need to know how to reach internal networks and where to send everything else. The default route (0.0.0.0/0) is that "send everything else here" instruction. In an OSPF domain, one border router — typically the one connected to the ISP or upstream network — holds the default route and must share it with all other OSPF routers so they automatically learn where to forward unknown destinations.
The default-information originate command causes
an OSPF router to generate a Type 5 External LSA for the
0.0.0.0/0 route and flood it throughout the entire OSPF domain. All routers
that receive it install the 0.0.0.0/0 route as O*E2 — marking
it as their Gateway of Last Resort. This eliminates the need
to manually configure a default route on every router in the OSPF domain.
Before starting, complete OSPF Single-Area Configuration and OSPF Multi-Area Configuration to understand OSPF neighbour adjacency and LSA types. Review Static Route Configuration for default route fundamentals. For OSPF neighbour state details, see OSPF Neighbour States.
1. How Default Route Distribution Works in OSPF
The ASBR Role
When a router runs default-information originate, it becomes an
ASBR (Autonomous System Boundary Router) — a router that
injects external routes into the OSPF domain. The default route does not
originate inside OSPF — it comes from a static route pointing toward an ISP
or upstream device. The ASBR takes that external route and packages it into
a Type 5 External LSA that floods to every router in every
OSPF area.
| Element | Role | Details |
|---|---|---|
| ASBR | The router that generates and floods the default route LSA | Identified by "It is an autonomous system boundary router" in show ip ospf |
| Type 5 External LSA | The LSA that carries the 0.0.0.0/0 route across the OSPF domain | Flooded to all areas — unlike Type 3 which stays between areas |
| O*E2 route | How the default route appears on downstream routers | O = OSPF, * = candidate default (Gateway of Last Resort), E2 = External Type 2 |
| E2 metric | The metric stays fixed at the ASBR's value regardless of topology distance | Default metric for redistributed routes — metric does not accumulate as it crosses routers |
default-information originate — Two Modes
| Command | Behaviour | When to Use |
|---|---|---|
default-information originate |
Generates the Type 5 LSA for 0.0.0.0/0 only if a default route already exists in the routing table (static or learned). If the default route disappears (ISP link down), the LSA is withdrawn automatically | ✅ Production standard — safer. Downstream routers lose the default route when the ISP link goes down, preventing traffic black holes |
default-information originate always |
Generates the Type 5 LSA for 0.0.0.0/0 unconditionally — even if no default route exists in the routing table | ⚠️ Lab use or specific design only — downstream routers keep the default route even when the exit is gone, causing a black hole at the ASBR |
always keeps advertising the default. Downstream
routers continue forwarding traffic toward the ASBR — which drops it because
it has no valid exit. Use always only in lab environments or
when a secondary exit exists.
Type 5 LSA vs Type 3 LSA
| Feature | Type 3 Summary LSA | Type 5 External LSA |
|---|---|---|
| Generated by | ABR | ASBR |
| Carries | Inter-area OSPF routes | Routes external to OSPF (static, BGP, redistributed) |
| Flooding scope | Into adjacent areas only | Entire OSPF domain — all areas |
| Route code | O IA | O E1 or O E2 (O*E2 for default) |
| Metric behaviour | Cost increases as it crosses routers | E2: fixed metric. E1: accumulates internal path cost |
2. Lab Topology & Scenario
NetsTuts_R1 is the edge router connected to a simulated ISP (203.0.113.1). It runs OSPF with R2 and R3 in Area 0. The goal is for R2 and R3 to automatically learn the internet default route from R1 via OSPF — without any static routes configured on R2 or R3.
Internet / ISP
203.0.113.1
|
Gi0/0 (WAN)
203.0.113.2
┌──────────────────┐
│ NetsTuts_R1 │ ← ASBR
│ RID: 1.1.1.1 │ (default-information originate)
└──────────────────┘
Gi0/1 Gi0/2
10.0.12.1 10.0.13.1
| |
10.0.12.0/30 10.0.13.0/30
| |
10.0.12.2 10.0.13.2
Gi0/0 Gi0/0
┌──────────────┐ ┌──────────────┐
│ NetsTuts_R2 │ │ NetsTuts_R3 │
│ RID: 2.2.2.2 │ │ RID: 3.3.3.3 │
└──────────────┘ └──────────────┘
Gi0/1 Gi0/1
192.168.20.1 192.168.30.1
192.168.20.0/24 192.168.30.0/24
(LAN — PC2) (LAN — PC3)
All routers: OSPF Area 0, Process 1
| Device | Interface | IP Address | Description |
|---|---|---|---|
| NetsTuts_R1 | Gi0/0 | 203.0.113.2 /30 | WAN — link to ISP (203.0.113.1) |
| NetsTuts_R1 | Gi0/1 | 10.0.12.1 /30 | OSPF link to R2 — Area 0 |
| NetsTuts_R1 | Gi0/2 | 10.0.13.1 /30 | OSPF link to R3 — Area 0 |
| NetsTuts_R2 | Gi0/0 | 10.0.12.2 /30 | OSPF link to R1 — Area 0 |
| NetsTuts_R2 | Gi0/1 | 192.168.20.1 /24 | LAN — PC2 |
| NetsTuts_R3 | Gi0/0 | 10.0.13.2 /30 | OSPF link to R1 — Area 0 |
| NetsTuts_R3 | Gi0/1 | 192.168.30.1 /24 | LAN — PC3 |
3. Step 1 — Configure OSPF on All Routers (Baseline)
First establish OSPF neighbour adjacency across all three routers in Area 0. The WAN interface (Gi0/0) on R1 is not included in OSPF — it connects to the ISP and should not participate in OSPF Hellos.
NetsTuts_R1 — OSPF (without default route yet)
NetsTuts_R1>en NetsTuts_R1#conf t Enter configuration commands, one per line. End with CNTL/Z. NetsTuts_R1(config)#router ospf 1 NetsTuts_R1(config-router)#router-id 1.1.1.1 NetsTuts_R1(config-router)#auto-cost reference-bandwidth 1000 NetsTuts_R1(config-router)#network 10.0.12.0 0.0.0.3 area 0 NetsTuts_R1(config-router)#network 10.0.13.0 0.0.0.3 area 0 NetsTuts_R1(config-router)#exit NetsTuts_R1(config)#end NetsTuts_R1#wr Building configuration... [OK] NetsTuts_R1#
network statements use
wildcard masks to match
the correct interfaces.
NetsTuts_R2
NetsTuts_R2>en NetsTuts_R2#conf t Enter configuration commands, one per line. End with CNTL/Z. NetsTuts_R2(config)#router ospf 1 NetsTuts_R2(config-router)#router-id 2.2.2.2 NetsTuts_R2(config-router)#auto-cost reference-bandwidth 1000 NetsTuts_R2(config-router)#network 10.0.12.0 0.0.0.3 area 0 NetsTuts_R2(config-router)#network 192.168.20.0 0.0.0.255 area 0 NetsTuts_R2(config-router)#passive-interface GigabitEthernet0/1 NetsTuts_R2(config-router)#exit NetsTuts_R2(config)#end NetsTuts_R2#wr Building configuration... [OK] NetsTuts_R2# %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
NetsTuts_R3
NetsTuts_R3>en NetsTuts_R3#conf t Enter configuration commands, one per line. End with CNTL/Z. NetsTuts_R3(config)#router ospf 1 NetsTuts_R3(config-router)#router-id 3.3.3.3 NetsTuts_R3(config-router)#auto-cost reference-bandwidth 1000 NetsTuts_R3(config-router)#network 10.0.13.0 0.0.0.3 area 0 NetsTuts_R3(config-router)#network 192.168.30.0 0.0.0.255 area 0 NetsTuts_R3(config-router)#passive-interface GigabitEthernet0/1 NetsTuts_R3(config-router)#exit NetsTuts_R3(config)#end NetsTuts_R3#wr Building configuration... [OK] NetsTuts_R3# %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on GigabitEthernet0/0 from LOADING to FULL, Loading Done
4. Step 2 — Configure Static Default Route on R1
Before OSPF can distribute the default route, R1 must have a default route in its own routing table. The static default route points to the ISP's gateway (203.0.113.1):
! ── Static default route toward ISP ────────────────────── NetsTuts_R1(config)#ip route 0.0.0.0 0.0.0.0 203.0.113.1 NetsTuts_R1(config)#end NetsTuts_R1#wr Building configuration... [OK] NetsTuts_R1#
Verify the Default Route Exists on R1
NetsTuts_R1#show ip route static Codes: S - static Gateway of last resort is 203.0.113.1 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 203.0.113.1
default-information originate
— without it, the command generates no LSA (unless always is used).
See show ip route for full route code reference.
5. Step 3 — Inject Default Route into OSPF
With the static default route confirmed on R1, add
default-information originate to R1's OSPF process.
This single command makes R1 the ASBR and floods the 0.0.0.0/0
route as a Type 5 External LSA to R2 and R3:
NetsTuts_R1(config)#router ospf 1 NetsTuts_R1(config-router)#default-information originate NetsTuts_R1(config-router)#end NetsTuts_R1#wr Building configuration... [OK] NetsTuts_R1#
always Keyword — Lab and Special Cases
! ── Force advertise even without a local default route ─── NetsTuts_R1(config-router)#default-information originate always
always in lab environments where no actual ISP link exists —
the static default route pointing to a real next hop is not required.
In production, avoid always unless you have a redundant exit
path or accept that the ASBR will black-hole traffic when the ISP link fails.
Optional: Set a Custom Metric on the Default Route
! ── Advertise with a specific metric value ─────────────── NetsTuts_R1(config-router)#default-information originate metric 50 metric-type 1
metric-type 1 changes it to E1 — the internal OSPF path
cost accumulates on top of the external metric as the route crosses routers.
E1 is useful when two ASBRs advertise the same default and you want routers
to prefer the closer one. E2 (default) keeps the metric uniform — all
downstream routers see the same cost regardless of their distance from the ASBR.
Dual ASBR Redundancy — Two Default Routes
In networks with two edge routers (R1 and R1B), both can run
default-information originate. Downstream routers receive
two Type 5 LSAs for 0.0.0.0/0 and select the best path based on metric.
Using metric-type E1 on both ASBRs ensures routers naturally prefer the
closest exit:
! ── On R1 (primary ISP) ────────────────────────────────── NetsTuts_R1(config-router)#default-information originate metric 10 metric-type 1 ! ── On R1B (backup ISP, higher metric = less preferred) ── NetsTuts_R1B(config-router)#default-information originate metric 100 metric-type 1
6. Verification
show ip route — R2 Receives O*E2
NetsTuts_R2#show ip route
Codes: C - connected, L - local, O - OSPF, E2 - OSPF external type 2
Gateway of last resort is 10.0.12.1 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 10.0.12.1, 00:01:22, GigabitEthernet0/0
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.0.12.0/30 is directly connected, GigabitEthernet0/0
L 10.0.12.2/32 is directly connected, GigabitEthernet0/0
O 10.0.13.0/30 [110/2] via 10.0.12.1, GigabitEthernet0/0
192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.20.0/24 is directly connected, GigabitEthernet0/1
L 192.168.20.1/32 is directly connected, GigabitEthernet0/1
O 192.168.30.0/24 [110/2] via 10.0.12.1, GigabitEthernet0/0
show ip route — R3 Receives O*E2
NetsTuts_R3#show ip route Codes: O - OSPF Gateway of last resort is 10.0.13.1 to network 0.0.0.0 O*E2 0.0.0.0/0 [110/1] via 10.0.13.1, 00:01:18, GigabitEthernet0/0
show ip ospf — R1 Identified as ASBR
NetsTuts_R1#show ip ospf Routing Process "ospf 1" with ID 1.1.1.1 ... It is an autonomous system boundary router Redistributing External Routes from, static, includes subnets in redistribution ...
show ip ospf database external — Type 5 LSA
NetsTuts_R1#show ip ospf database external
OSPF Router with ID (1.1.1.1) (Process ID 1)
Type-5 AS External Link States
LS age: 87
Options: (No TOS-capability, DC, Upward)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number)
Advertising Router: 1.1.1.1
LS Seq Number: 80000001
Checksum: 0x7D61
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
Metric: 1
Forward Address: 0.0.0.0
External Route Tag: 0
show ip ospf database external — on R2
NetsTuts_R2#show ip ospf database external
OSPF Router with ID (2.2.2.2) (Process ID 1)
Type-5 AS External Link States
LS age: 112
Advertising Router: 1.1.1.1
Link State ID: 0.0.0.0
Network Mask: /0
Metric Type: 2
Metric: 1
ping 8.8.8.8 from R2 — End-to-End Verification
NetsTuts_R2#ping 8.8.8.8 source GigabitEthernet0/1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 18/20/22 ms NetsTuts_R2#
Verification Command Summary
| Command | What to Look For | Run On |
|---|---|---|
show ip route |
"Gateway of last resort is..." and O*E2 0.0.0.0/0 entry | R2, R3 (downstream) |
show ip route static |
S* 0.0.0.0/0 — confirms the prerequisite default route exists on the ASBR | R1 (ASBR) |
show ip ospf |
"It is an autonomous system boundary router" — confirms ASBR role | R1 (ASBR) |
show ip ospf database external |
Type 5 LSA for 0.0.0.0, Advertising Router = ASBR's RID, Metric Type 2 | Any router in the domain |
show ip ospf neighbor |
All neighbours FULL — prerequisite for LSA flooding to work | All routers |
ping [public IP] |
Successful pings confirm end-to-end internet reachability via OSPF default | R2, R3 (downstream) |
7. Troubleshooting Default Route Distribution Issues
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| O*E2 route not appearing on downstream routers | show ip route on R2/R3 shows no Gateway of Last Resort and no 0.0.0.0/0 entry |
No static default route on R1 — default-information originate (without always) requires a default route to exist first |
Add ip route 0.0.0.0 0.0.0.0 [next-hop] on R1. Verify with show ip route static — confirm S* 0.0.0.0/0 exists. Then re-check downstream routers. |
| Default route present but internet traffic fails | O*E2 route exists on R2/R3 but pings to 8.8.8.8 fail | R1's WAN interface is down or the ISP next hop (203.0.113.1) is unreachable | Verify R1's WAN interface: show ip interface brief. Ping 203.0.113.1 from R1. Check ISP link status. |
| Default route withdrawn when ISP link flaps | O*E2 disappears from R2/R3 during ISP instability | Expected behaviour — default-information originate (without always) withdraws the LSA when the static default route disappears |
This is correct production behaviour — prevents black holes. If stability is needed regardless, use always with a secondary exit path. |
| Two ASBRs both advertising default — wrong one selected | Traffic exits via the backup ISP when primary is up | Both ASBRs using E2 (fixed metric) — downstream routers see identical cost and may use either ASBR | Switch both to metric-type E1 with different base metrics. Primary ASBR uses lower metric. Internal OSPF path cost accumulates, naturally directing traffic to the closer/preferred ASBR. |
| R1 not identified as ASBR | show ip ospf on R1 does not say "autonomous system boundary router" |
default-information originate was not entered, or was entered but no default route exists (and always was not used) |
Verify the command exists in show running-config | section router ospf. Check that ip route 0.0.0.0 0.0.0.0 is in the routing table. |
| Default route not reaching routers in non-backbone areas | Routers in Area 1 or Area 2 have no O*E2 default route | The area is configured as a stub area — stub areas block Type 5 External LSAs by design | Stub areas receive a Type 3 default route instead. If the area must receive the specific ASBR's default, change it from stub to normal area. See OSPF Multi-Area Configuration. |
Key Points & Exam Tips
default-information originatecauses the OSPF router to generate a Type 5 External LSA for 0.0.0.0/0 — flooding the default route to every router in the OSPF domain.- The command requires a default route to already exist in the routing table (S* 0.0.0.0/0). Without it, no LSA is generated. Use
alwaysto override this requirement. See Static Route Configuration for how to add the prerequisite default route. - The router running
default-information originatebecomes an ASBR — confirmed by "It is an autonomous system boundary router" inshow ip ospf. - Downstream routers install the default route as O*E2 0.0.0.0/0. The asterisk marks it as the Gateway of Last Resort. The E2 metric stays fixed regardless of hop count. Verify with
show ip route. default-information originate alwaysadvertises 0.0.0.0/0 even without a local default route — useful in labs but risky in production as it can create black holes when the ISP link is down.- Use metric-type 1 (E1) instead of the default E2 when two ASBRs both advertise the default route — E1 accumulates internal path cost, directing each router to naturally prefer the closest exit.
- The WAN interface connecting to the ISP should not be included in the OSPF
networkstatement — it does not participate in OSPF Hellos or LSAs. Use passive-interface on LAN-only interfaces. show ip ospf database externalconfirms the Type 5 LSA exists — key fields are Link State ID (0.0.0.0), Advertising Router (ASBR's RID), and Metric Type (1 or 2).- Stub areas block Type 5 External LSAs — routers in stub areas cannot receive the OSPF default route via
default-information originate. They receive a Type 3 summary default instead. - On the CCNA exam: know the difference between
default-information originate(conditional) anddefault-information originate always(unconditional), and what O*E2 means in the routing table. For OSPF troubleshooting, see Troubleshooting OSPF Neighbour Adjacency.