Default Routes in Cisco IOS

We often see the incorrect implementation and understanding of ‘default routes’.  The default route is a “gateway of last resort.”  This special route tells computers or other routers to contact the defined next hop of the default router if they don’t have a more specific route.  

Without a default route, a router would need all internet routing (think what that would do to your Linksys!).  Since the routers do not have this information, without a default route a router will drop a packet destined for a network that isn’t in its routing table and send ICMP Destination Unreachable to the source of the traffic.

Here’s a simple example: Your PC has an IP address of 192.168.1.27 and a subnet mask of 255.255.255.0 or /24. Let’s say we want to talk to a server on the LAN, which has an IP address of 192.168.1.2.

For this to work, we actually don’t need a default route or default gateway configured on the PC (they are in the same subnetwork). However, as soon as we want to talk to any other device not on the 192.168.1.0/24 network, we’ll need to go to the default gateway/route — for example, one at 192.168.1.1.

When talking about default gateways on PCs and default routes on routers and switches, it’s important to differentiate between the two.  A PC only connects to the network with a single interface, and it isn’t a router; a switch (unless it’s a Layer 3 switch) fits into the same category as the PC.

On the other hand, a router — as long as it’s really routing and not bridging — has multiple interfaces. It uses a default route to know where to send traffic that isn’t on one of the known networks.

Many times, people call default routes “0/0” routes because these routes have an IP address of 0.0.0.0 and a subnet mask of 0.0.0.0. This basically says, “For any IP address that has any subnet mask, send it my way.”

What does a default route look like in a router’s routing table? Here’s an example:

Cell_P1# show ip route
<truncated>

Gateway of last resort is 192.168.1.1 to network 0.0.0.0

C 192.168.1.0/24 is directly connected, FastEthernet0
S* 0.0.0.0/0 [254/0] via 192.168.1.1

Here’s what it looks like on a PC:

C:/> ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.27
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

There are three ways to obtain a default route.

1. Configure a static route.
2. Receive a default route from another router through a routing protocol (not usually used on a PC).
3. Receive a default route via DHCP.

You can use the ‘ip default-network’ command to set a default route on a router, we recommend just creating a static route using the ip route command. Here’s an example of configuring a default route on a router or switch:

Cell_P1(config)# ip route 0.0.0.0 0.0.0.0 192.168.1.1

What the command says is that for all traffic that doesn’t go to one of the locally connected interfaces, forward it to the router at IP address 191.168.1.1. (Of course, the router also has to know how to get to that IP address, so make sure you specify one of your connected networks on one of the router’s interfaces.)

Now, we want this route advertised to neighbor routers. Here is the example for RIP:

Cell_P1(config)# router rip
Cell_P1(config-router)# default-information originate

This sends the default route to all other RIP routers (as shown above in the first example). For other protocols, be sure to look at how this is implemented.

Short and sweet.  We hope this helps with explaining Default Routes.

Leave a Comment

Contact Us Here


Please verify.
Validation complete :)
Validation failed :(
 
Your contact request has been received. We usually respond within an hour, but please be patient. We will get back to you very soon.
Scroll to Top