Reference

Core

Default Routes

A default route is the gateway of last resort used to forward traffic when no more specific route matches, commonly used for internet-bound traffic or stub sites.

What you need to know

  • A default route is written as network 0.0.0.0 with mask 0.0.0.0, matching any destination.
  • The router always prefers the most specific (longest prefix) match over the default route.
  • Default routes can be static or learned dynamically and redistributed via a routing protocol.
  • In OSPF, a router originates a default route into the domain using default-information originate.
  • The default-information originate always keyword advertises a default even if the originating router lacks one itself.
  • show ip route shows the default route marked with an asterisk and the label gateway of last resort.
  • Stub and totally stubby OSPF areas rely on an injected default route to reach networks outside the area.

Configuration commands

CommandModePurpose
ip route 0.0.0.0 0.0.0.0 203.0.113.1configConfigure a static default route pointing to the ISP next hop.
ip default-network 172.16.0.0configFlag a network as a candidate default route for classful protocols.
router ospf 1configEnter OSPF configuration to advertise a default route.
default-information originateconfig-routerAdvertise a default route into OSPF if one exists in the routing table.
default-information originate alwaysconfig-routerForce advertisement of a default route into OSPF regardless of local table.
ip route 0.0.0.0 0.0.0.0 gigabitethernet0/0configConfigure a default route using an exit interface.

Verify it

  • show ip route
  • show ip route 0.0.0.0
  • show ip protocols
  • show ip ospf database external
  • ping 8.8.8.8

Common mistakes

  • Forgetting default-information originate so OSPF never advertises the default route.
  • Assuming default-information originate works without always when no default route exists locally.
  • Configuring a default route on the wrong interface, sending traffic to a dead end.
  • Expecting the default route to override a more specific matching route.
  • Not testing reachability beyond the immediate next hop after adding a default route.

Practise Default Routes in a real CLI

Generated labs, graded against the simulated network state.

Start a free lab