Imagine your router receives a packet destined for a network it has never heard of — no specific route in the routing table, no clue where to send it. Without a default route, that packet is simply dropped. In real networks, you can't possibly know every remote network on the internet, so default routes are essential for reaching any destination beyond your local domain. This chapter covers default routes, a core IP connectivity topic for CCNA 200-301 exam objective 3.2, and a fundamental tool in every network engineer's toolkit.
Jump to a section
Think of your router as the supervisor of a large mailroom in a corporate office building. The mailroom receives thousands of letters every day, each addressed to a specific employee. The supervisor has a detailed directory that lists every employee's desk location by department and floor. When a letter arrives for someone in the directory, the supervisor knows exactly which bin to drop it in for internal delivery. But what about a letter addressed to a person who doesn't work in the building — say, a customer at a different company across town? The supervisor has no entry for that person in the local directory. Without a default procedure, the letter would be thrown in the trash (dropped). Instead, the supervisor has a standing rule: any letter for an unrecognized recipient goes into the 'outgoing mail' bin, which is picked up by the postal service at 5 PM. That outgoing bin is the default route — a catch-all for anything the local directory doesn't cover. The postal service then takes over, using its own nationwide routing system to deliver the letter. If the supervisor mistakenly set the outgoing bin to go to the wrong postal carrier, or if the bin is full and letters spill onto the floor, delivery fails. In networking terms, the default route (0.0.0.0/0) is that 'outgoing bin' — it matches any destination IP address not found in the routing table, and forwards the packet to a next-hop router (the postal service) that hopefully knows where to go from there.
What Is a Default Route and Why Does It Exist?
A default route is a special entry in a router's routing table that matches any destination IP address. It is also called the "gateway of last resort." In IPv4, the default route is represented as 0.0.0.0/0, meaning a network address of all zeros with a prefix length of zero. This prefix length means that zero bits of the destination IP address must match — so every destination matches. The default route is used when no other more specific route (longer prefix match) exists for a packet's destination.
Why do we need default routes? Because no router can know every network on the internet. The global routing table contains hundreds of thousands of routes, but even that is a subset of all possible networks. For a router that connects a local network to the internet (a stub router), it only needs to know about its directly connected networks and one default route pointing toward the ISP. Without a default route, the router would drop any packet destined for an unknown network, effectively cutting off access to the internet.
How Default Routes Work Step by Step
When a router receives an IP packet, it performs a longest-prefix match lookup in its routing table. The router examines the destination IP address and compares it against all routes, selecting the route with the longest matching prefix (most specific). If no match is found, the router then checks for a default route (0.0.0.0/0). If a default route exists, the packet is forwarded according to that route (out the specified interface or to the specified next-hop). If no default route exists, the router drops the packet and sends an ICMP Destination Unreachable message back to the source.
Key points:
The default route has the shortest possible prefix length (0), so it only matches if no other route matches.
A default route can be statically configured or dynamically learned via routing protocols (e.g., OSPF default-information originate, EIGRP summary route).
The router's "gateway of last resort" is the next-hop IP address or outgoing interface specified by the default route.
Default Route Configuration in IOS
To configure a static default route on a Cisco IOS router, use the ip route command with a destination network of 0.0.0.0 and a mask of 0.0.0.0. There are two common styles:
1. Pointing to a next-hop IP address:
ip route 0.0.0.0 0.0.0.0 10.1.1.1This tells the router to forward all unmatched traffic to the router at 10.1.1.1.
2. Pointing to an exit interface:
ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0This tells the router to send all unmatched traffic out of interface GigabitEthernet0/0. This is often used on point-to-point links where the next-hop is implicitly known. However, using an interface alone can cause issues on multi-access networks because the router must ARP for every destination (which can overwhelm the router). For Ethernet interfaces, it is safer to include the next-hop IP address.
Verification Commands
To verify the default route is installed, use:
show ip routeLook for a line starting with S* (for static default route) or O* (for OSPF-learned default route). Example 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, GigabitEthernet0/0Key fields:
- S*: S means static, * means candidate default route.
- [1/0]: Administrative distance (1 for static) and metric (0).
- via 10.1.1.1: Next-hop IP.
- GigabitEthernet0/0: Outgoing interface.
Also use:
show ip route 0.0.0.0This shows details of the default route specifically.
Default Routes and Routing Protocol Interaction
Default routes can be injected into dynamic routing protocols. For example, in OSPF, the default-information originate command generates a default route into the OSPF domain. This is common on a router that has a default route to the internet — it advertises that default to other routers in the OSPF area, so they all can reach the internet without each needing a static default.
Important exam point: A default route is only injected into OSPF if it already exists in the routing table (unless you use the always keyword). For EIGRP, you can redistribute a static default route or use the ip default-network command.
Administrative Distance and Multiple Default Routes
If a router learns multiple default routes from different sources (e.g., static and OSPF), it will choose the one with the lowest administrative distance. For example:
- Static default route: AD = 1 - OSPF-learned default route: AD = 110 The static default will be preferred because 1 < 110. If two default routes have the same AD, the router will load-balance (per destination) if both are equal cost.
Default Route vs. Default Network
Cisco IOS also supports the ip default-network command, which designates a specific network as the default network. This is older and less common, but still appears on the exam. The command ip default-network 10.0.0.0 tells the router to consider the route to 10.0.0.0 as the default route. However, static default route (0.0.0.0/0) is the modern and recommended method.
Configure a Static Default Route
Enter global configuration mode on the router. Use the command `ip route 0.0.0.0 0.0.0.0 <next-hop-ip>` to create a static default route. For example, `ip route 0.0.0.0 0.0.0.0 10.1.1.1`. This tells the router to send all packets with no matching route to the router at 10.1.1.1. Alternatively, you can specify an exit interface: `ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0`. The interface method is simpler but can cause issues on multi-access networks because the router will ARP for every destination IP, which can be inefficient and may lead to high CPU usage. Always prefer specifying a next-hop IP on Ethernet links.
Verify the Default Route in the Routing Table
Use the `show ip route` command to confirm the default route is present. Look for an entry starting with `S*` (static default) or `O*` (OSPF default). The output should show `Gateway of last resort is <next-hop> to network 0.0.0.0`. If the default route is missing, check that the next-hop is reachable (e.g., the interface is up/up and the next-hop IP is in the same subnet). Also verify that the static route was entered correctly — a common error is using a wrong mask (e.g., 255.255.255.0 instead of 0.0.0.0).
Test Connectivity Using the Default Route
From a host on the local network, ping a public IP address like 8.8.8.8. If the default route is working, the router forwards the packet to the next-hop (ISP router). If the ping fails, check the following: (1) Is the default route in the routing table? (2) Does the next-hop router have a route back to your network? (3) Are there any ACLs blocking traffic? Use `traceroute` from the router to see the path: `traceroute 8.8.8.8`. This will show each hop and can pinpoint where the packet is dropped.
Configure a Floating Static Default Route
A floating static default route is a backup default route with a higher administrative distance (e.g., AD 200). It is used when the primary default route fails. Configure: `ip route 0.0.0.0 0.0.0.0 10.1.1.2 200`. The `200` is the administrative distance. The primary default route (AD 1) will be used while it is available. If the primary route is removed (e.g., interface goes down), the floating static route will appear in the routing table. This is useful for backup WAN links.
Inject a Default Route into OSPF
On a router that already has a default route (e.g., static default to ISP), you can advertise it into OSPF using the `default-information originate` command in OSPF router configuration mode. Example: `router ospf 1` then `default-information originate`. This will cause the router to generate a Type 5 LSA (if OSPF is in a regular area) or Type 3 LSA (if in a NSSA) for 0.0.0.0/0. Other OSPF routers will then learn this default route. If the default route is not present in the routing table, OSPF will not originate it unless you add the `always` keyword: `default-information originate always`.
Troubleshoot Missing Default Route
If a router is not using the default route, use `show ip route` to check if it's present. If it's missing, verify the static route configuration. If it's present but traffic is not forwarded, check the next-hop reachability with `ping <next-hop>`. Also check for recursive routing: the next-hop IP must be reachable via another route (e.g., a connected route). For example, if the next-hop is 10.1.1.1 but the router has no route to the 10.1.1.0/24 network, the default route will not be installed. Use `show ip cef` to see if the prefix is in the Forwarding Information Base.
In enterprise networks, default routes are everywhere. Consider a branch office connected to the corporate headquarters via a WAN link. The branch router typically has a few connected subnets for local users and a single default route pointing to the head office router. This default route ensures that any traffic destined for the internet or other branch offices goes through the head office, which then has more specific routes or another default route to the ISP. This design simplifies the branch router's routing table and reduces administrative overhead.
Another common scenario is a dual-homed connection where an enterprise has two ISPs for redundancy. Network engineers configure two default routes: one pointing to ISP A with AD 1, and another pointing to ISP B with AD 200 (floating static). Under normal conditions, all traffic goes through ISP A. If the link to ISP A fails, the floating static route becomes active, and traffic switches to ISP B. This provides automatic failover without dynamic routing protocols.
In data centers, default routes are used on leaf switches in a spine-leaf architecture. Leaf switches connect to servers and have a default route pointing to the spine switches. The spine switches have full knowledge of all prefixes (or default routes to the border routers). This keeps the leaf switch routing table small and allows the fabric to scale.
Misconfiguration of default routes can cause black holes. For example, if the next-hop IP of a default route is misconfigured or unreachable, the route will not be installed, and traffic to unknown destinations will be dropped. Another common mistake is creating a routing loop: if Router A has a default route pointing to Router B, and Router B has a default route pointing to Router A, packets destined to unknown networks will bounce between them until the TTL expires. This is a serious problem that can be avoided by carefully planning default route distribution.
Performance considerations: Using an interface-only default route on a multi-access network (like Ethernet) causes the router to perform an ARP lookup for every destination IP that hits the default route. This can overwhelm the router's CPU and ARP table. Always specify the next-hop IP in such cases.
The CCNA 200-301 exam tests default routes under objective 3.2 (IP Connectivity). You must be able to configure, verify, and troubleshoot static default routes. Expect scenario-based questions where you must choose the correct command to configure a default route, or interpret the output of show ip route to identify the default route.
Common wrong answers: 1. Using `ip route 0.0.0.0 255.255.255.255 <next-hop>` — Candidates mistakenly use a mask of all ones (255.255.255.255) thinking it matches everything. Actually, that mask means the route matches only the specific address 0.0.0.0, which is useless. The correct mask is 0.0.0.0. 2. Confusing default route with default gateway — On a host, you configure a default gateway (a single IP). On a router, you configure a default route (0.0.0.0/0) pointing to a next-hop. The exam may test this distinction. 3. Thinking a default route is always present — A router does not have a default route by default. You must configure it or learn it via a routing protocol. 4. Forgetting administrative distance — When multiple default routes exist, the one with the lowest AD wins. A static default (AD 1) beats an OSPF default (AD 110).
Key values and outputs:
- The command ip route 0.0.0.0 0.0.0.0 <next-hop> is the standard.
- In show ip route, the default route appears as S* 0.0.0.0/0 [1/0] via ....
- The Gateway of last resort line shows the next-hop.
Decision rule for scenario questions: If a router needs to reach the internet and you have a single upstream router, configure a static default route. If there are multiple upstream routers, consider floating statics or dynamic routing. Always ensure the next-hop is reachable via a connected route or another static route.
Calculation traps: None specific to default routes, but be careful with subnet masks — the mask must be 0.0.0.0, not 255.255.255.0 or /24.
A default route (0.0.0.0/0) matches any destination IP address and is used when no more specific route exists.
Configure a static default route with: ip route 0.0.0.0 0.0.0.0 <next-hop-ip>.
Verify with: show ip route — look for S* 0.0.0.0/0 and the Gateway of last resort line.
Default routes can be learned dynamically via routing protocols (e.g., OSPF default-information originate).
When multiple default routes exist, the one with the lowest administrative distance is preferred.
A floating static default route uses a higher AD (e.g., 200) for backup purposes.
Using an interface-only default route on Ethernet can cause excessive ARP — always specify next-hop IP.
These come up on the exam all the time. Here's how to tell them apart.
Static Default Route
Manually configured by administrator
AD = 1 (very reliable)
Does not adapt to network changes automatically
Simple and low overhead
Best for stub networks with single upstream
Dynamic Default Route (OSPF)
Learned via OSPF routing protocol
AD = 110 (higher than static)
Automatically updates if topology changes
Requires OSPF configuration and processing
Best for larger networks with multiple routers
Mistake
A default route is automatically configured on every router.
Correct
No default route exists by default; it must be manually configured or learned via a routing protocol.
Candidates often assume routers have a built-in default route, but they only have connected and local routes initially.
Mistake
The command 'ip route 0.0.0.0 255.255.255.255 <next-hop>' creates a valid default route.
Correct
The correct mask for a default route is 0.0.0.0; 255.255.255.255 matches only the address 0.0.0.0, which is useless.
Candidates confuse subnet masks with wildcard masks or think a mask of all ones matches everything.
Mistake
A default gateway and a default route are the same thing.
Correct
A default gateway is configured on a host (e.g., PC) and is a single IP address. A default route is configured on a router and is a route entry (0.0.0.0/0) with a next-hop or exit interface.
The terms sound similar, but they apply to different devices and have different configurations.
Mistake
A router will always use the default route even if a more specific route exists.
Correct
The router uses the longest prefix match; a more specific route (e.g., /24) is always preferred over the default route (/0).
Candidates sometimes think the default route overrides everything, but it is the least specific.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
A default gateway is configured on end devices (like PCs) and is a single IP address that the device uses to send packets to destinations outside its local subnet. A default route is configured on routers and is a routing table entry (0.0.0.0/0) that matches any destination. The router uses the default route to forward packets when no more specific route exists. In short, hosts have default gateways; routers have default routes.
Yes, a router can have multiple default routes from different sources (e.g., static and OSPF). The router will choose the one with the lowest administrative distance (AD). If two default routes have the same AD and metric, the router will load-balance per destination. You can also configure multiple static default routes with different ADs for redundancy (floating static).
The 'S' indicates a static route. The asterisk (*) indicates that the route is a candidate default route. This is how Cisco IOS marks routes that can be used as the default route (gateway of last resort). The router will use the candidate default route with the lowest administrative distance.
Use the `default-information originate` command in OSPF router configuration mode. This will inject a default route (0.0.0.0/0) into the OSPF domain. The router must have a default route in its own routing table (e.g., a static default) for this to work, unless you use the `always` keyword. Example: `router ospf 1` then `default-information originate`.
A floating static default route is a static default route configured with a higher administrative distance (e.g., 200) than the primary default route. It acts as a backup: it is only installed in the routing table when the primary default route is removed (e.g., due to a link failure). This is used for WAN redundancy, such as having a primary MPLS link and a backup internet link.
Yes, you can use `ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0`. However, on multi-access networks (like Ethernet), this can cause the router to perform ARP for every destination IP, which can be inefficient and may lead to high CPU usage. It is generally recommended to specify a next-hop IP address on Ethernet links. On point-to-point links, using an interface is fine.
It means there is no default route (0.0.0.0/0) in the routing table. The router will drop any packet destined to a network not found in the routing table. To fix this, configure a static default route or ensure a routing protocol is injecting a default route.
You've just covered Default Routes — now see how well it sticks with free CCNA 200-301 practice questions. Full explanations included, no account needed.
Done with this chapter?