OSPF · · 4 min read

How to Advertise a Default Route in OSPF

How to Advertise a Default Route in OSPF

The default-information originate Command

Format:

Router(config-router)# default-information originate [always] [metric value] [metric-type {1 | 2}]

What it does:


Basic Configuration

Scenario:

Edge router (R1) has Internet connectivity via 0.0.0.0/0 static route. Advertise it to internal routers.

R1 Configuration:

interface gi0/0
 description Internet link
 ip address dhcp

ip route 0.0.0.0 0.0.0.0 gi0/0

router ospf 1
 default-information originate

Result:


Verification

Check Default Route on Internal Routers

R2 (internal router):

R2# show ip route
Gateway of last resort is 10.1.1.1 to network 0.0.0.0

O*E2  0.0.0.0/0 [110/1] via 10.1.1.1, 00:05:23, GigabitEthernet0/0

Key indicators:


Check OSPF Database

R2:

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: 123
  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: 0xABCD
  Length: 36
  Network Mask: /0
        Metric Type: 2 (Larger than any link state path)
        MTID: 0
        Metric: 1
        Forward Address: 0.0.0.0
        External Route Tag: 0

Key fields:


The always Keyword

Problem:
By default, default-information originate only works if the router already has a default route in its routing table.

Scenario:
R1's Internet link goes down. Static default route is removed from routing table. OSPF stops advertising 0.0.0.0/0.

Result:
Internal routers lose their default route and can't reach the Internet.


Solution: Use always

Router(config-router)# default-information originate always

What always does:

⚠️ Warning: Use carefully. If R1 advertises 0.0.0.0/0 but has no Internet connectivity, traffic black-holes.


Setting the Metric

Default metric: 1

To change it:

Router(config-router)# default-information originate metric 100

Use case:
You have two edge routers. One is primary (metric 10), one is backup (metric 100). Routers prefer the primary.

Example:

R1 (primary):

router ospf 1
 default-information originate metric 10

R2 (backup):

router ospf 1
 default-information originate metric 100

Result:
Internal routers prefer R1 (lower cost). If R1 fails, they fail over to R2.


Metric Type: E1 vs E2

OSPF external routes can be Type 1 (E1) or Type 2 (E2).

E2 (Default)

E1

Configuration:

Router(config-router)# default-information originate metric-type 1

When to use E1:

When to use E2 (default):


Dual Default Route (Redundancy)

Scenario:

Two edge routers for redundancy.

R1 (primary):

router ospf 1
 default-information originate metric 10

R2 (backup):

router ospf 1
 default-information originate metric 100

Internal router view:

R3# show ip route
O*E2  0.0.0.0/0 [110/10] via 10.1.1.1, GigabitEthernet0/0
               [110/100] via 10.1.2.1, GigabitEthernet0/1

Result:


Conditional Default Route Advertisement (Advanced)

Scenario:
Only advertise default route if Internet is reachable.

Uses IP SLA tracking:

Step 1: Create IP SLA probe

ip sla 1
 icmp-echo 8.8.8.8 source-interface gi0/0
 frequency 30
ip sla schedule 1 life forever start-time now

Step 2: Track the probe

track 1 ip sla 1 reachability

Step 3: Conditional default route

ip route 0.0.0.0 0.0.0.0 gi0/0 track 1

router ospf 1
 default-information originate

Result:


Common Mistakes

Mistake 1: Using always Without Understanding

Problem:

router ospf 1
 default-information originate always

(Router has no Internet connectivity)

Impact:
Router advertises 0.0.0.0/0, but traffic black-holes.

Fix:
Only use always if you understand the implications. Otherwise, rely on static default route existence.


Mistake 2: Multiple ASBRs with Same Metric

Problem:
Both R1 and R2 advertise default route with metric 1.

Impact:
ECMP load-balancing. If one path is slower, traffic suffers.

Fix:
Set different metrics to prefer one router.


Mistake 3: Advertising Default into Stub Areas

Problem:
You manually configure default-information originate on an ABR in a stub area.

Impact:
Stub areas already get a default route automatically from the ABR. Manual config is redundant.

Fix:
Let stub area ABR auto-generate the default route.


Best Practices

1. Use Conditional Advertisement (IP SLA)

Prevent black-holing by only advertising when Internet is up.


2. Set Metrics for Redundancy

Primary: low metric
Backup: high metric


3. Document in Config

router ospf 1
 ! Advertise default route for Internet access
 default-information originate metric 10

4. Monitor Default Route

Set up alerts if default route disappears from internal routers.


Summary

Now you know:

Why default routes matter — Internet connectivity for internal routers
default-information originate — Injects 0.0.0.0/0 into OSPF
always keyword — Advertises even without default route in table
Metric control — Prefer primary over backup
E1 vs E2 — Metric calculation differences
Conditional advertisement — IP SLA tracking for reliability

Next Step:
You've mastered single-area OSPF and default routes. Ready to scale? Learn How to Configure Multi-Area OSPF next.


Screenshot Suggestions:

  1. Topology: Edge router advertising default route to internal routers
  2. show ip route on internal router showing O*E2 route
  3. show ip ospf database external output for 0.0.0.0
  4. Dual edge router topology with primary/backup metrics

Internal Links:

Read next

© 2025 Ping Labz. All rights reserved.