Why can R1 reach the exit when the other routers cannot?
Let's say PC-1 and PC-2 can reach each other, but neither can reach a network beyond R1. R1 already has a default route. In IPv4, that is prefix 0.0.0.0/0: it matches every destination, but any matching longer prefix takes priority. It is the fallback when the router has no more specific route. The missing step is telling R2 and R3 to use that exit.
We'll follow one network through four situations. OSPF (Open Shortest Path First) is the routing protocol the internal routers use to share network information. This IPv4 lesson uses OSPF version 2 (OSPFv2).
Keep two questions separate: does R1 know a way out, and have the other routers learned to use it? A working answer to the first question does not automatically answer the second.
What does the network look like before the change?
PC-1 uses R2 at 192.168.2.1 as its gateway. PC-2 uses R3 at 192.168.3.1. The router links already run OSPF in normal area 0, a part of the OSPF network that can carry external route records. R1 connects to the upstream router labelled ISP, or Internet Service Provider.
In this isolated lab, the ISP router has a software interface, Loopback0, at 198.51.100.10/32. We use this documentation address as an external test target, not a real Internet website. R1's static default points to the ISP at 203.0.113.1.
Gi means GigabitEthernet, a physical network interface. A router ID (RID) identifies a router in OSPF; it does not have to be the IP used to reach it. R1 uses RID 1.1.1.1, R2 uses 2.2.2.2 and R3 uses 3.3.3.3. The diagram labels the interface IPs separately.
A default in R1's routing table is not automatically advertised through OSPF. Without another matching route, R2 and R3 cannot send traffic to our external target.
Figure 1 separates the three decisions. Read the numbered callouts from R1 on the right towards R3 on the left. Solid grey lines are physical connections. The small table shows only R3's selected default, not its complete routing table.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
At number 1, R1 already knows an exit. Its next hop, 203.0.113.1, is the ISP's interface on the directly connected /30 link. R1 can use that route for a destination outside its known networks. R1's own ISP-facing address is 203.0.113.2; the two ends of this cable have different addresses.
At numbers 2 and 3, a connected cable is not enough. R2 and R3 know their internal OSPF routes, but neither has a route that matches 198.51.100.10. R3's empty default row therefore means “no fallback exit”, not “no routes at all”. PC-2 can still reach PC-1 through the internal network.
Check R1 first. This shortened output confirms its local default:
R1#show ip route 0.0.0.0 S* 0.0.0.0/0 [1/0] via 203.0.113.1
Follow a packet from PC-2 before we change anything. Its gateway R3 checks destination 198.51.100.10. None of its internal routes matches, and no default is installed. It drops the packet there. The packet does not reach R1 just because R1 has an ISP cable.
How do we tell the other routers about the exit?
On R1, enter default-information originate under the OSPF process. Here, originate means create and announce the route information.
R1 creates a Type 5 link-state advertisement (LSA), an OSPF record describing an external route. It describes 0.0.0.0/0. R2 receives the information and passes it towards R3.
R1 now has an additional OSPF role: autonomous system boundary router (ASBR). In this example, it introduces a route from outside OSPF into the OSPF network. R2 does not become an ASBR merely because it passes R1's record on.
Each router chooses its own next hop towards R1. R2 uses R1 at 10.0.12.1; R3 uses its immediate neighbour R2 at 10.0.23.1.
Figure 2 uses exactly the same cables, interfaces and addresses. Only the default-origination policy has changed. The dashed arrows point left because they show OSPF information moving away from R1; they are not the path of a browser request.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Number 1: R1 creates the external route record. The Type 5 LSA identifies prefix 0.0.0.0/0, external metric type E2 and metric 1. Its advertising-router field identifies R1 as 1.1.1.1. That router ID identifies the originator; it is not an instruction to use 1.1.1.1 as the next-hop IP.
Number 2: R2 calculates its own forwarding choice. R2 receives the LSA, calculates its path towards the originator and installs the default through R1's adjacent interface, 10.0.12.1.
R2 also floods the same external route information towards R3. It is passing on R1's record, not originating a different external default under R2's router ID.
Number 3: R3 selects its immediate neighbour, R2. The table in Figure 2 shows 10.0.23.1 through R3's Gi0/0. R3 cannot use the ISP address as a directly connected next hop: the ISP is several links away. The E2 metric stays 1 in this baseline; it does not mean the ISP is one hop away.
Now repeat PC-2's request to 198.51.100.10. The forwarding direction is PC-2 → R3 → R2 → R1 → ISP.
R3 resolves R2's local MAC with ARP if it is not cached, then sends a frame to R2. The IP packet still names the external target as its destination. Each router checks that destination and builds the next Ethernet frame; it does not put the whole route into the packet.
The reply also needs the return routes prepared in the lab below.
R3#show ip route 0.0.0.0 O*E2 0.0.0.0/0 [110/1] via 10.0.23.1, GigabitEthernet0/0
Read the advertisement as well as the route
The routing table shows R3's selected forwarding route. Its OSPF database shows the record R1 announced. Look for these fields:
R3#show ip ospf database external 0.0.0.0 Link State ID: 0.0.0.0 Advertising Router: 1.1.1.1 Network Mask: /0 Metric Type: 2 Metric: 1 Forward Address: 0.0.0.0
What happens if R1's link to the ISP fails?
Now disconnect R1's Gi0/2 link. We assume this removes R1's only installed default, while its internal OSPF link stays working.
Removing a broken exit does not create another exit. Without an alternative route, the external destination remains unreachable.
Figure 3 marks the failed ISP cable with a red cross. The dashed arrows now represent the withdrawal information travelling through the still-working internal OSPF network.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Number 1: R1 loses the condition for plain origination. The interface failure removes the usable path to the static next hop in this lab, so R1's only default leaves its routing table. With no always or route-map, R1 stops originating that default and flushes its external LSA.
Numbers 2 and 3: the other routers process the change. R2 receives and floods the withdrawal; R3 receives it through R2. Each router recalculates the affected route. After convergence, the default row is gone on R3.
A later packet to the external target has no matching route and is dropped, rather than being sent towards a known failed exit. The directly connected links and internal OSPF routes remain available.
Withdrawal means removing previously announced information. The change is carried in a Link State Update (LSU), an OSPF packet that can carry LSA records. An LSA is a record; an LSU is the packet carrying it.
Does every withdrawal rebuild all the paths?
OSPF uses shortest path first (SPF) to calculate paths from its network information. An external-route change requires affected routes to be recalculated, but does not necessarily rebuild the whole shortest-path tree. The work depends on the change and router software. An originator can withdraw an LSA by advertising it at MaxAge, the expiry age used to flush the record.
What changes if we add always?
The alternative default-information originate always keeps announcing the default even when R1 has no default in its own routing table. We are not applying a route-map, a policy that can change the conditions for advertisement.
Always keeps the advertisement; it does not repair the connection. Keeping a default stable can reduce changes in its advertisement, but a failed exit can keep attracting traffic. It needs a deliberate routing design.
Figure 4 keeps the failed cable from Figure 3 and changes only the origination policy. Compare the retained row in R3's table with the empty row in Figure 3.
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Number 1: R1 keeps originating despite its missing exit. The always keyword removes the normal requirement for an installed default in this unqualified example. It does not add a replacement static route, bring the interface up or repair the ISP.
Numbers 2 and 3: R2 and R3 still have a valid-looking advertisement. They retain their next hops towards R1 and keep forwarding otherwise unmatched traffic along that path.
R1 receives the packet but has no usable onward or more-specific route, so it drops it. This is a black hole: an advertised path attracts traffic that cannot be delivered. An installed default on R3 alone therefore does not prove that the external test will succeed.
What if the link stays up but service beyond it fails?
R1's untracked static default may stay installed if the ISP next hop is still reachable. Even plain origination can then continue. An interface showing up/up confirms local link state; an installed route confirms a routing entry. Neither proves that an external service is available.
See an extended example with a server beyond the ISP
This alternative places the test address on a server behind the ISP, instead of ISP Loopback0. LAN 3 has an extra client, PC-C at 192.168.3.20. The transit interface addresses are unchanged. Use one external-target model at a time.
- Internal routing map
- R3 RID 3.3.3.3, Gi0/0 10.0.23.2/30 → R2 RID 2.2.2.2, Gi0/1 10.0.23.1/30. R2 Gi0/0 10.0.12.2/30 → R1 RID 1.1.1.1, Gi0/1 10.0.12.1/30. Normal area 0, P2P, Full, Hello 10 / Dead 40 s, no authentication; outgoing routed costs 10.
- Client and switch
- PC-C 192.168.3.20/24, gateway 192.168.3.1 → SW3 Gi0/2. SW3 Gi0/1 → R3 Gi0/1 192.168.3.1/24 (OSPF passive). Existing LAN server .10 omitted.
- External example
- R1 Gi0/2 203.0.113.2/30 ↔ ISP Gi0/0 203.0.113.1/30 (outside OSPF). ISP Gi0/1 198.51.100.1/24 ↔ server Ethernet 198.51.100.10/24, gateway 198.51.100.1. Documentation IPs, not a live service. Return routes and permitting policy assumed; real Internet access needs suitable addressing/NAT.
- Default and failure assumptions
- Plain origination; no route-map, always or tracking. ISP next hop stays reachable; R1's static default remains installed despite failure beyond it.
Try the change, then verify it
Use an isolated Cisco IOS or IOS XE practice lab. Assign the diagram's addresses, enable the interfaces and establish the internal OSPF neighbours first. The router links use OSPF point-to-point; the LAN interfaces are enabled in area 0 but passive, meaning they advertise their networks without forming neighbours with PCs. The ISP link is outside OSPF.
Start at R1's privileged EXEC # prompt. The commands below are documentation-based examples; they have not been run on a physical router.
configure terminal
ip route 0.0.0.0 0.0.0.0 203.0.113.1
router ospf 1
default-information originate
endR1 only. Create the local static default, then advertise it through the existing OSPF process. This baseline uses no always, route-map or metric override.
configure terminal enters configuration mode. The ip route line creates R1's local exit. router ospf 1 selects the local process; its number does not have to match R2's process number. The next line shares the default. end returns to the # prompt.
Check the result in this order
- On R1, use
show ip route 0.0.0.0to confirm the installed static default. - On R3, use
show ip ospf database external 0.0.0.0to find R1's Type 5 record. - On R3, use
show ip route 0.0.0.0to confirm the selected next hop is R2 at 10.0.23.1.
| What you see | Check next | Why |
|---|---|---|
| R1 has no default | Gi0/2 addressing, link state and static next hop. | Plain origination needs an installed default. |
| R1 has a default; R3 has no LSA | Origination command, neighbours and area type. | A local exit can exist without a usable advertisement. |
| R3 has the LSA but no OSPF default | Path to R1 and competing default routes. | A database record and an installed route are different things. |
| The default is installed but ping fails | Next hops, ARP, return routes and filtering. | The request and reply both need working paths. |
ARP (Address Resolution Protocol) finds the next device's MAC address on a local IPv4 Ethernet link. A route can be present while that delivery fails. The ARP lesson explains the exchange.
Prepare the simulated ISP and test the return path
After configuring ISP Gi0/0 as 203.0.113.1/30, add the target and return routes. Start at the ISP's # prompt:
configure terminal
interface Loopback0
ip address 198.51.100.10 255.255.255.255
exit
ip route 192.168.2.0 255.255.255.0 203.0.113.2
ip route 192.168.3.0 255.255.255.0 203.0.113.2
endLab ISP only. Add the documentation test destination and explicit routes back to both PC networks through R1.
Ping 198.51.100.10 from both PCs. This routed lab uses explicit return routes and no network address translation (NAT), which changes IP addresses as traffic passes through a device. Real Internet access needs suitable addressing or NAT, upstream routes and permitting policies too.
Test the failure, then restore the link
configure terminal
interface GigabitEthernet0/2
shutdown
endR1 only, isolated failure test. Disable the ISP interface, then check the defaults on R1 and R3. Internal OSPF interfaces stay active.
After the change is processed, R1 loses its static default and R3 loses this learned default. PC-1 and PC-2 should still reach each other. Restore Gi0/2 with no shutdown and confirm the routes return.
Optional: compare always and restore the original policy
First restore Gi0/2 and the working baseline. Then replace the policy on R1:
configure terminal
router ospf 1
no default-information originate
default-information originate always
endR1 only. Alternative policy for comparison, not a repair. Repeat the ISP-interface shutdown and observe that R3 retains the default.
The route remaining on R3 is the expected difference; it does not mean the external test works. Finish by restoring the interface and plain origination:
configure terminal
interface GigabitEthernet0/2
no shutdown
exit
router ospf 1
no default-information originate
default-information originate
endR1 only. Return the isolated lab to its original working policy and verify the routes and PC tests.
Go further: compare E1 and E2 external metrics
A metric is the number OSPF uses when comparing paths of the same route type. The lesson above uses the plain command's E2 metric 1. For this separate comparison, set the external starting metric to 10. Internal outgoing interface costs are 10, giving R3 a cost of 20 to R1.
- Topology and assumptions
- R1 RID 1.1.1.1, Gi0/1 10.0.12.1/30 ↔ R2 RID 2.2.2.2, Gi0/0 10.0.12.2/30; R2 Gi0/1 10.0.23.1/30 ↔ R3 RID 3.3.3.3, Gi0/0 10.0.23.2/30. Normal area 0, P2P, Full. All routed outgoing costs 10 (gigabit, reference 10000 Mbps), no manual overrides.
- External LSA
- R1 has an installed default via ISP 203.0.113.1 through Gi0/2 203.0.113.2/30. Type 5 LSA prefix 0.0.0.0/0, advertising RID 1.1.1.1, forwarding address 0.0.0.0, so internal cost is to R1. No route-map or competing route source. R3 next hop is R2 10.0.23.1 in both cases.
With E2, R3's displayed external metric is 10. With E1, it adds the internal cost: 10 + 20 = 30. For the same prefix, OSPF prefers an eligible E1 external route over E2 before comparing their displayed numbers. E2 ties can still depend on internal cost.
router ospf 1
no default-information originate
default-information originate metric 10 metric-type 2
exitR1 only, from global configuration mode. Separate E2 comparison; replace the previous policy and use one policy at a time.
router ospf 1
no default-information originate
default-information originate metric 10 metric-type 1
exitR1 only, from global configuration mode. Separate E1 comparison. With forwarding address zero, R3 adds its cost to R1 to the external metric.
Return to plain default-information originate after this comparison if you want the original metric-1 outputs.
For further investigation, follow OSPF troubleshooting. For a complete internal-router build, use the single-area configuration lesson.
References: Cisco default-route origination, IOS command reference, and RFC 2328, sections 14.1 and 16.4.
Test yourself on OSPF default routes
In normal area 0, R1 uses plain default-information originate without always or a route-map. It has no installed default; no other router originates one. After convergence, what do R2 and R3 see?
R3 shows O*E2 0.0.0.0/0 [110/1]. R1 is two routers away. Why is the metric 1?
R1's ISP link fails and its only onward default disappears. Internal OSPF stays healthy; R1 uses default-information originate always with no route-map. No alternate exit or more-specific route exists. What happens to external traffic from LAN 3?
Which router becomes an ASBR in this lesson?