Courseiva
OSPFRouter Config

default-information originate

The default-information originate command is used in OSPF router configuration mode to generate a default route (0.0.0.0/0) into the OSPF domain, typically when the router has a default route from another source like a static route or connected to an ISP.

Definition: default-information originate is a Cisco IOS router config command. The default-information originate command is used in OSPF router configuration mode to generate a default route (0.0.0.0/0) into the OSPF domain, typically when the router has a default route from another source like a static route or connected to an ISP.

Overview

The `default-information originate` command is a critical OSPF configuration directive used to inject a default route (0.0.0.0/0) into the OSPF routing domain. This command is typically employed on an Autonomous System Boundary Router (ASBR) that has a default route learned from an external source, such as a static route pointing to an ISP or a default route from another routing protocol. By originating a default route into OSPF, the router advertises itself as the gateway of last resort for all other OSPF routers in the area, enabling them to reach external networks without needing specific routes. This is essential in hub-and-spoke topologies, branch office connectivity, and internet edge designs where centralized outbound traffic is desired.

The underlying concept is that OSPF, as a link-state protocol, does not inherently generate a default route. Without this command, OSPF routers only know about networks explicitly advertised within the OSPF domain. The `default-information originate` command forces the ASBR to create a Type 5 External LSA (or Type 7 NSSA LSA in not-so-stubby areas) for the default route, which is then flooded throughout the OSPF domain. This command is often used in conjunction with a static default route (e.g., `ip route 0.0.0.0 0.0.0.0 10.0.1.1`) or a default route from another protocol like BGP. The command can also be configured with the `always` keyword to advertise a default route even if the router does not have one in its routing table, which is useful for backup or forced default scenarios.

Network engineers reach for this command when they need to provide internet or WAN connectivity to remote sites without running BGP or static routes on every router. It simplifies routing by allowing all internal routers to rely on a single default route. Alternatives include using a static default route on each router (which is less scalable) or using BGP to propagate a default route (which is more complex). The command fits into the broader configuration workflow after OSPF is enabled and interfaces are in the correct areas. It is typically applied on the router that connects to the external network, often after verifying that the router itself has a default route. Important IOS behaviors include: the command is available in router configuration mode (config-router), it requires privilege level 15, and it immediately modifies the running configuration. The generated default route appears as an O*E2 or O*IA route in the routing table of other routers, depending on the metric type. The command does not affect the router's own routing table; it only influences OSPF advertisements. Engineers must ensure that the default route is not accidentally originated from multiple routers, which could cause suboptimal routing or loops. Additionally, the `metric` and `metric-type` parameters allow tuning the cost and type of the external route, affecting how other routers select the default path.

Syntax·Router Config
default-information originate

When to Use This Command

  • Inject a default route into OSPF from a router connected to the internet via a static default route.
  • Redistribute a default route learned from another routing protocol (e.g., BGP) into OSPF for internal networks.
  • Provide a gateway of last resort to all OSPF routers in a stub area or NSSA.
  • Force a default route into OSPF even if no default route exists in the routing table (using the always keyword).

Parameters

ParameterSyntaxDescription
alwaysalwaysCauses the router to always advertise a default route into OSPF, even if it does not have a default route in its routing table. This is useful for backup scenarios or when you want to force a default route regardless of the router's own routing state. Common mistake: using this without a static default route may cause blackholing if the router cannot actually reach external networks.
metric<0-16777214>Sets the metric (cost) for the default route. The value can range from 0 to 16777214. If not specified, the default metric is 10 for external type 2 routes. Common mistake: setting a metric too low may cause suboptimal routing if multiple ASBRs advertise defaults; setting it too high may prevent the route from being used.
metric-type<1-2>Specifies the OSPF external metric type. Type 1 (E1) adds the internal cost to the external metric, while Type 2 (E2) uses only the external metric. Default is Type 2. Common mistake: using Type 1 without understanding that it makes the route more sensitive to internal path costs, which can lead to unexpected path selection.
route-maproute-map WORDAssociates a route-map to conditionally originate the default route. The route-map can match on conditions such as the existence of a specific route or interface state. Common mistake: forgetting to create the route-map or misconfiguring match criteria, causing the default route not to be advertised.

Command Examples

Basic default route injection with static route

ip route 0.0.0.0 0.0.0.0 192.168.1.1 router ospf 1 default-information originate
Router# show ip route ospf
     0.0.0.0/0 is subnetted, 1 subnets
O*E2 0.0.0.0/0 [110/1] via 192.168.1.1, 00:00:05, GigabitEthernet0/0

The output shows an OSPF external type 2 (O*E2) default route with metric 1, learned via 192.168.1.1. The asterisk indicates the default candidate. The administrative distance is 110 and the route was learned 5 seconds ago.

Always advertise default route

router ospf 1 default-information originate always
Router# show ip route ospf
     0.0.0.0/0 is subnetted, 1 subnets
O*E2 0.0.0.0/0 [110/1] via 10.0.0.1, 00:00:03, GigabitEthernet0/1

The always keyword forces the router to advertise a default route even if it does not have one in its routing table. The output is similar but the route is generated regardless of the existence of a default route.

Understanding the Output

When you use 'default-information originate', the router will generate an OSPF LSA Type 5 (external) for the default route 0.0.0.0/0. In the routing table, you will see an entry starting with 'O*E2' (OSPF external type 2) or 'O*E1' if the metric-type is set to 1. The asterisk indicates this is the default route candidate.

The metric shown is the cost assigned (default 1 for type 2). The next-hop IP is the router's interface IP towards the default destination. The age (e.g., 00:00:05) shows how long the route has been in the table.

A good value is a recent age; an old age might indicate a stale route. If the route disappears, check that the originating router still has a default route (unless 'always' is configured). Also verify that OSPF neighbor adjacencies are established and that the area type (stub, NSSA) allows external routes.

Configuration Scenarios

Inject a default route from an ISP-connected router into OSPF

A branch office router (R1) connects to an ISP via a static default route. The internal OSPF network includes R2 and R3. R1 must advertise a default route into OSPF so that R2 and R3 can reach the internet.

Topology

R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R2 R1(Gi0/1)---10.0.13.0/30---(Gi0/0)R3 R1(Gi0/2)---ISP (198.51.100.1)

Steps

  1. 1.Step 1: Enter global configuration mode: configure terminal
  2. 2.Step 2: Configure a static default route pointing to the ISP: ip route 0.0.0.0 0.0.0.0 198.51.100.1
  3. 3.Step 3: Enter OSPF router configuration: router ospf 1
  4. 4.Step 4: Advertise the default route: default-information originate
  5. 5.Step 5: Exit and verify: end, show ip route | include 0.0.0.0/0
Configuration
!
interface GigabitEthernet0/0
 ip address 10.0.12.1 255.255.255.252
 ip ospf 1 area 0
!
interface GigabitEthernet0/1
 ip address 10.0.13.1 255.255.255.252
 ip ospf 1 area 0
!
interface GigabitEthernet0/2
 ip address 198.51.100.2 255.255.255.252
!
ip route 0.0.0.0 0.0.0.0 198.51.100.1
!
router ospf 1
 network 10.0.12.0 0.0.0.3 area 0
 network 10.0.13.0 0.0.0.3 area 0
 default-information originate
!

Verify: On R2 or R3: show ip route ospf. Expected output includes an O*E2 entry: O*E2 0.0.0.0/0 [110/1] via 10.0.12.1, 00:00:05, GigabitEthernet0/0. Also verify on R1: show ip route 0.0.0.0 shows the static route.

Watch out: If the static default route is removed or the ISP link goes down, R1 stops advertising the default route into OSPF. Use the 'always' keyword to keep advertising even without a local default, but ensure there is a backup path or risk blackholing.

Conditionally originate a default route using a route-map

In a dual-homed scenario, R1 and R2 both connect to different ISPs. Only one router should advertise a default route into OSPF at a time, based on the presence of a specific route (e.g., a BGP-learned route to a monitoring server).

Topology

R1(Gi0/0)---10.0.12.0/30---(Gi0/0)R3 R2(Gi0/0)---10.0.23.0/30---(Gi0/1)R3 R1(Gi0/1)---ISP1 (203.0.113.1) R2(Gi0/1)---ISP2 (203.0.113.5)

Steps

  1. 1.Step 1: Create a route-map that matches the presence of a specific route: route-map CHECK permit 10, match ip address prefix-list MONITOR
  2. 2.Step 2: Define the prefix-list: ip prefix-list MONITOR permit 10.0.0.0/8 le 32
  3. 3.Step 3: Apply the route-map to default-information originate: router ospf 1, default-information originate route-map CHECK
  4. 4.Step 4: Ensure the route-map references exist and are correct.
Configuration
!
ip prefix-list MONITOR permit 10.0.0.0/8 le 32
!
route-map CHECK permit 10
 match ip address prefix-list MONITOR
!
router ospf 1
 network 10.0.12.0 0.0.0.3 area 0
 default-information originate route-map CHECK
!

Verify: On R3: show ip route ospf. If R1 has the 10.0.0.0/8 route (e.g., from BGP), the default route appears via R1. If not, no default is advertised. Use show ip ospf database external on R3 to see the LSA. On R1: show route-map CHECK to see match counts.

Watch out: The route-map condition is evaluated when the OSPF process decides to originate the default. If the matched route flaps, the default route may be withdrawn and re-advertised, causing routing instability. Use route-map with 'continue' or additional match criteria to add stability.

Troubleshooting with This Command

When troubleshooting issues with `default-information originate`, the first step is to verify that the router itself has a default route in its routing table (unless the `always` keyword is used). Use `show ip route 0.0.0.0` to confirm. If the default route is missing, check the upstream connectivity or static route configuration.

Next, examine the OSPF configuration with `show running-config | section router ospf` to ensure the command is present. If the command is missing, reapply it. Then, check the OSPF database on the originating router: `show ip ospf database external` should show a Type 5 LSA for 0.0.0.0.

If not, the router may not be an ASBR (check with `show ip ospf`). Ensure that OSPF is enabled on at least one interface and that the router is not in a stub area (Type 5 LSAs are not allowed in stub areas; use `area stub no-summary` or NSSA with `default-information originate`). On other routers, use `show ip route ospf` to see if the default route is received.

If the route is missing, check OSPF neighbor adjacencies with `show ip ospf neighbor`. If neighbors are down, troubleshoot Layer 1/2 issues. If the default route appears but traffic fails, verify the next-hop reachability and that the ASBR has a valid path to the external network.

Use `traceroute` from a remote router to the default next-hop. If the `always` keyword is used, ensure that the router does not advertise a default when it cannot actually reach external networks, as this can cause blackholing. In such cases, consider using a route-map to conditionally originate based on a reliable indicator like a tracked object or IP SLA.

Correlate with `debug ip ospf lsa-generation` to see when the default LSA is generated. Healthy output shows the LSA being originated with correct metric and type. Problem indicators include no LSA generation, incorrect metric, or LSA being flushed immediately.

Also check for routing loops: if multiple ASBRs advertise defaults, ensure metrics are set appropriately to prefer one path. Use `show ip route` to verify the routing table on each router. Finally, check the OSPF process with `show ip ospf` to confirm the router role (ASBR) and that the default-information originate is enabled.

If the command is present but not working, examine route-map conditions if used, and verify that the matched route exists with `show ip route` and `show route-map`.

CCNA Exam Tips

1.

Remember that 'default-information originate' requires a default route in the routing table unless the 'always' keyword is used.

2.

The default metric type is E2 (external type 2), which does not add internal cost; you can change it to E1 with the 'metric-type 1' keyword.

3.

In a stub area, you cannot use 'default-information originate' because stub areas block Type 5 LSAs; instead, use 'area stub' with 'default-information originate' on the ABR.

4.

The 'always' keyword is often tested as a way to inject a default route even when no default exists.

Common Mistakes

Forgetting to configure a default route (static or from another protocol) before using 'default-information originate' without the 'always' keyword, resulting in no default route being advertised.

Using 'default-information originate' in a stub area without proper configuration; stub areas do not accept Type 5 LSAs, so the command will not work as expected.

Not setting the metric or metric-type, leading to suboptimal routing if multiple default routes exist.

default-information originate vs show ip ospf database

These two OSPF commands serve different purposes but are often mentioned together in troubleshooting scenarios: one injects a default route into OSPF, while the other displays the resulting OSPF link-state database.

Aspectdefault-information originateshow ip ospf database
FunctionGenerates default route into OSPF domainDisplays OSPF link-state database
ModeRouter configuration mode (config-router)Privileged EXEC mode
Effect on NetworkAdvertises default LSA to OSPF neighborsNo effect; read-only inspection
PersistencePersistent in running-config until removedNon-persistent; transient output
Typical Use CaseBorder router injecting default route from ISPVerifying OSPF LSAs for missing routes
Output/ResultCreates Type 5 or Type 7 default LSADisplays LSDB entries with type, age, sequence

Use default-information originate when you need the router to advertise a default route to OSPF neighbors, typically on a border router with a default route from another source.

Use show ip ospf database when verifying OSPF LSAs to ensure correct routing information is being learned or to troubleshoot missing routes.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the `default-information originate` command syntax is identical to classic IOS. However, IOS-XE may have additional OSPF features like OSPFv3 for IPv6, where the command is `default-information originate` under `ipv6 router ospf`. The output format of `show ip ospf database external` is similar but may include additional fields like LS age in seconds.

In NX-OS (e.g., Nexus switches), the equivalent command is `default-information originate` under `router ospf` as well, but NX-OS uses a different configuration hierarchy and requires the `feature ospf` command first. NX-OS also supports the `always` keyword and route-map. However, NX-OS does not support the `metric-type` keyword; instead, use `metric` and `route-map` to control type.

For ASA firewalls, OSPF is supported in routed mode, and the command is `default-information originate` under `router ospf`. ASA uses a similar syntax but may have limitations on route-map support. In IOS-XR (e.g., ASR 9000), the command is `default-information originate` under `router ospf` as well, but the configuration is done in a different mode (XR config mode).

IOS-XR also supports the `always` and `metric` options, but route-map is specified differently using `route-policy`. For example: `default-information originate always metric 20 route-policy CHECK`. The command exists in all major IOS versions (12.x, 15.x, 16.x) with consistent behavior, but older versions may have bugs related to route-map evaluation.

Always check the specific version documentation for caveats. In general, the command is widely supported across Cisco platforms, making it a reliable tool for OSPF default route injection.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions