Default Route in the Routing Table
Default gateway routes in routing tables allow routers to forward all unmatched data packets. Routers use default gateway routes as the last route to forward data packets.
When a router receives a data packet, it compares the packet's destination address against the destination addresses of all available routes in the routing table.
- If it finds a match, it forwards the packet from the matching route.
- If it finds multiple matches, it forwards the packet along the route that matches the maximum number of IP bits.
- If it does not find a match, it discards the packet.
If you want the router to forward all unmatched packets to a specific destination instead of discarding them, you can configure a default route to that destination. If a router has a default route, it uses it to forward all unmatched packets.
The following image shows a router's routing table entries. The 'show ip route' command prints the routing table's entries.

The router receives a data packet for the destination 20.0.0.1/8. The router compares the destination address with all routes' destination addresses. It finds two matches: 20.0.0.0/8 (a directly connected route - C) and 20.0.0.1/32 (a local route - L). As mentioned, if a router finds two or more matches, it selects the route with the maximum matching IP bits. In this case, the local route has the maximum matching IP bits. It matches all 32 bits. Hence, the router selects this route.

Routers select a route only when the network bits (the number of bits specified after the slash) of the destination address exactly match the packet's destination address's network bits. For example, the router will take the route 20.0.0.0/8 when the packet's destination address's first 8 bits exactly match. The router will take the route 20.0.0.1/32 when the packet's destination address exactly matches 20.0.0.1.
Let us suppose the router receives another data packet for the destination 20.0.0.10/8. In this case, the router cannot take the local route 20.0.0.1/32. Only 8 bits of this route match the destination address. The router can take this route only when all 32 bits are the same. The second route requires the first eight matching bits. The packet's destination address's first 8 bits exactly match the first 8 bits of this route. Therefore, the router will take the second route 20.0.0.0/8.

Suppose the router receives a data packet for the destination address 50.0.0.1/8. It finds no routes having the matching bits. In this case, it checks the default route. If the routing table has no default route, it discards the packet. If yes, it uses that to forward the packet. Since this routing table has a default route, the router uses it to forward the packet.

This tutorial is part of the tutorial series "Routing Table Updating Methods and Route Types". Other parts of this series are the following.
Chapter 1 The show ip route command on Routers
Chapter 2 Routing Table Updating Methods
Chapter 3 Directly Connected Routes and Local Routes
Chapter 4 Static and Floating Static Routes Explained
Chapter 5 Static and Dynamic routes in the Routing table
Chapter 6 Default Route in the Routing Table
Chapter 7 Network Routes and Host Routes Explained
Chapter 8 CCNA Exam Practice Question with Answer 1
Conclusion
Routers use routing table entries to make forwarding decisions. If the routing table does not have a matching entry for an incoming packet, the router discards that packet. A default gateway entry overrides this behaviour. It allows routers to forward all packets with unknown destination addresses.
Author Laxmi Goswami Updated on 2025-12-09