Home CCNA How to Configure a Default Route on a Cisco Router
CCNA

How to Configure a Default Route on a Cisco Router

A Router With Specific Routes To Nearby Networks And One Wide Catch-All Default Route To Everything Else

A default static route is a route that matches any destination network not otherwise present in a router’s routing table. Routers use default routes that are either configured locally as static entries or learned dynamically from another router through a routing protocol — this guide covers the static configuration.

Decision Flowchart Showing A Router Choosing Between A Specific Route And The Default Route
The Router Always Checks For A Specific Match Before Falling Back To Default

[See Infographic: Default Route as the Catch-All Path]

What Is a Default Route?

A default route is used whenever no other, more specific route in the routing table matches a packet’s destination IP address. Because of this role, it’s also known as the Gateway of Last Resort. The administrative distance for a default static route is 1, the same as any other static route — there’s no special AD treatment for a default route just because its destination happens to be 0.0.0.0/0 rather than a specific network.

Default routes show up most often in two situations, and recognizing them is a useful shortcut when deciding whether a default route is the right tool for a given design:

  • An edge router connecting to a service provider network, where holding a specific route for every reachable destination on the internet simply isn’t practical
  • A stub router serving a stub network, where there’s only ever one possible path out regardless of the destination

The command syntax matches an ordinary static route, with one difference: the destination network address and subnet mask are both 0.0.0.0, instead of a specific network address:

Router(config)# ip route 0.0.0.0 0.0.0.0 {ip-address | exit-interface}

Configuring a Default Static Route

Consider a topology where Router2 is a stub router, connected only to Router1. Because Router2 has exactly one path out, a default route is a more efficient choice than configuring individual static routes to every network Router1 knows about.

Router2(config)# ip route 0.0.0.0 0.0.0.0 FastEthernet0/1

This tells Router2: for any packet that doesn’t match a more specific route already in the table, forward it out FastEthernet0/1 toward Router1. From there, Router1 handles routing the packet to its actual destination using its own, more complete routing table.

The same command works with a next-hop IP address instead of an exit interface:

Router2(config)# ip route 0.0.0.0 0.0.0.0 10.1.1.1

Here, 10.1.1.1 is Router1’s interface address on the link between the two routers. As with any static route, the choice between an exit interface and a next-hop IP address follows the same point-to-point versus multi-access guidance that applies to static routes generally.

Topology Diagram Showing A Stub Router'S Default Route Pointing To Its Single Upstream Neighbor
One Link Out Means One Default Route Is All That’S Needed

[See Infographic: Configuring a Default Route on a Stub Router]

Verifying a Default Static Route

Check the routing table with either of these commands:

Router2# show ip route
Router2# show ip route static

Expected output:

Gateway of last resort is 10.1.1.1 to network 0.0.0.0

S*   0.0.0.0/0 [1/0] via 10.1.1.1

Two details in this output matter. First, the top line explicitly names the Gateway of Last Resort and the next hop used to reach it. Second, the route entry itself carries two codes: S marks it as a static route, and the asterisk (*) marks it as the candidate default route — the specific route selected to serve as the gateway of last resort. That asterisk is what to look for when confirming a default route is active and correctly selected. If a router has multiple static routes configured with a 0.0.0.0/0 destination — unusual, but possible in a floating-default-route setup — only one of them carries the asterisk at any given time, since only one route can actually serve as the active gateway of last resort.

The /0 at the end of 0.0.0.0/0 is the subnet mask expressed in prefix length, and it’s worth understanding exactly what it means rather than just memorizing it. In a routing table, the mask determines how many bits of a packet’s destination address must match the route’s network address for that route to apply. A binary 1 in the mask means that bit position must match; a binary 0 means it doesn’t matter what value is there. A /0 mask has zero bits set to 1 — meaning no bits are required to match at all. That’s exactly why 0.0.0.0/0 matches every possible destination: it imposes no matching requirement whatsoever, so it only gets used when nothing more specific applies first.

Binary Comparison Of A /0 Mask Requiring No Matching Bits Against A /24 Mask Requiring 24
Zero Required Bits Means Nothing Is Excluded

[See Infographic: Why a /0 Mask Matches Every Destination]

Default Routes and Dynamic Routing Together

A default route doesn’t have to be purely static. It’s common to configure it as a static entry at a stub site while the core network runs a dynamic routing protocol, or to have a router learn a default route dynamically from an upstream neighbor — for example, via OSPF’s default-information originate command, which advertises a router’s own default route to the rest of an OSPF domain. Whichever way it’s learned, a default route’s job is the same: catch every packet that doesn’t match anything more specific, and send it toward the one router most likely to know what to do with it next.

This hybrid approach is genuinely common in real deployments. A distribution-layer or core router might run OSPF or EIGRP internally to reach every subnet within the organization, while also holding a single static default route pointing toward its internet service provider for anything outside the organization entirely. That default route can then be redistributed into the dynamic protocol using default-information originate, so every other router in the domain automatically learns where to send internet-bound traffic without needing its own static default route configured individually. This keeps internal routing dynamic and adaptive while keeping the actual internet-facing configuration centralized on the one or two routers that hold the real upstream connection.

IPv6 Default Route Configuration

The same concept applies to IPv6, using ::/0 as the IPv6 equivalent of 0.0.0.0/0:

Router2(config)# ipv6 route ::/0 2001:DB8:1::1

Verify with:

Router2# show ipv6 route static

The output follows the same logic as IPv4: the route is marked as a static default candidate, and it matches any IPv6 destination not covered by a more specific route already in the table. As with IPv4, an IPv6 default route can be configured statically or learned dynamically from a neighboring router running OSPFv3 or another IPv6-capable routing protocol.

Common Mistakes When Configuring a Default Route

Configuring the wrong mask. A default route requires both the network address and mask to be all zeros — 0.0.0.0 0.0.0.0. Entering anything other than a full /0 mask by mistake turns the route into a specific route matching only a narrow range of addresses, rather than a true catch-all, and it silently stops functioning as a default route without necessarily producing an obvious error.

Expecting the default route to override more specific routes. A router always prefers the most specific matching route in its table over the default route, regardless of administrative distance. If traffic isn’t taking the expected path, check whether a more specific static or dynamic route to that destination already exists — the default route will never be selected while a better match is present, since matching specificity is checked before administrative distance comes into play.

Forgetting that the default route needs a working next hop. A default route configured with an interface or IP address that isn’t actually reachable will still appear in the routing table, but traffic sent to it will fail. Confirm the next hop or exit interface is up and correctly connected with show ip interface brief before assuming the default route configuration itself is at fault — a route that’s syntactically correct but points at a dead link produces symptoms that look identical to a missing default route entirely, which makes this an easy mistake to misdiagnose without checking interface status directly.

Example Topology

[See Topology Diagram: Stub Router with a Static Default Route to the Core]

A practical lab: connect Router2 as a stub router with a single link to Router1, which in turn connects onward to additional networks Router2 doesn’t have specific routes for. Configure the default static route on Router2 pointing toward Router1, verify with show ip route static, and confirm the S* code and the Gateway of Last Resort line both appear correctly. Then add a new network behind Router1 that Router2 has no specific route to, and confirm traffic from Router2 still reaches it successfully via the default route — demonstrating exactly why the default route removes the need to add a new static entry every time the network behind Router1 grows.

Frequently Asked Questions

What is the purpose of a default route?

A default route acts as a catch-all forwarding instruction, ensuring a router or host can still forward traffic toward destinations that aren’t explicitly listed anywhere in its routing table. It’s most commonly used to point a network’s edge router toward its internet service provider, since a router has no practical way to hold a specific route for every network on the internet. It’s equally essential for stub networks with only one path out, where the default route is simply the only path traffic can take regardless of the specific destination.

How is a default route different from a specific static route?

A specific static route matches only one particular destination network, defined by its exact network address and subnet mask, and is only used for traffic actually headed to that network. A default route uses 0.0.0.0/0 as its destination, which — because of how the /0 mask works — matches every possible destination that doesn’t have a more specific route already in the table. In practice, a router always checks for the most specific matching route first, and only falls back to the default route when nothing more specific applies, which is exactly why adding a new specific route never disrupts existing default-route-based forwarding for every other destination.

Can a default route be learned dynamically instead of configured statically?

Yes — routers can learn a default route dynamically from a neighboring router through a routing protocol, rather than having it manually configured. For example, an OSPF router can be configured to originate and advertise a default route to the rest of its OSPF domain using default-information originate, letting every other router in that domain learn the default route automatically instead of needing it configured individually. Static and dynamic default routes accomplish the same forwarding behavior; the difference is purely in how the route gets into the routing table in the first place, and in practice large networks often use dynamic default-route propagation specifically to avoid manually maintaining the same static entry on dozens of individual routers.

How do I confirm which route is acting as the gateway of last resort?

Run show ip route and look at the top line of the output, which explicitly states the current gateway of last resort and the next hop used to reach it. In the routing table entries themselves, the specific route serving that role is marked with an asterisk next to its route code — for example, S* for a static default route — distinguishing it from any other static routes that might also be present in the table. If no gateway of last resort is set, that line will say so explicitly, which is a useful first check when default-route-dependent traffic isn’t reaching its destination, since it immediately tells you whether the problem is a missing default route or something further along the path.

Avatar Of Muhammad Khattak
Muhammad Khattak

Author

Routing and switching specialist, CCNA certified, with extensive experience in network configuration and troubleshooting. Covers OSPF, EIGRP, VLAN management, and advanced routing concepts.

Related Articles