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.
default-information originateWhen 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).
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 originateRouter# 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/0The 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 alwaysRouter# 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/1The 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.
CCNA Exam Tips
Remember that 'default-information originate' requires a default route in the routing table unless the 'always' keyword is used.
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.
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.
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.
Related Commands
show ip ospf database
Displays the OSPF link-state database (LSDB) to verify OSPF adjacencies, check for missing or corrupt LSAs, and troubleshoot OSPF routing issues.
show ip route
Displays the current IP routing table on a Cisco router, used to verify routes, check next-hop addresses, and troubleshoot connectivity issues.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions