How to configure Default Route

A default static route is a route, that represents any network, not in the routing table of that router. Routers normally use default routes that are configured locally or learned from another router, using a dynamic routing protocol.

A default route is used when there are no other routes that match in the routing table for the destination IP address of the packet. This route is also known as the Gateway of Last Resort. The administrative distance for the default static route is 1. The common use of the default route is the following:

  • An edge router to a service provider network
  • A stub router and Stub network

The command syntax is also similar to the static route. The only difference between both is the network address. The default static route use a network address and the subnet mask is Instead of the original network address:

  • ip route {ip-address exit-interface }

Configure a Default Static Route

Router2 is a stub router because it is only connected to Router1. So, we can configure the default static route and it would be more efficient with default static route.

The example in the figure configures a default static route on Router1. So, any packets not matching more specific route entries are forwarded to exit interface Fast Ethernet 0/1.

default route configuration

Verify a Default Static Route

We can verify it using, the show ip route command and for more specific output we can use the command as “show ip route static”. The output will show the contents of the routing table. Verify the asterisk (*)next to the route with code ‘S’, the mark for the default static route.

The asterisk with “S: just like displayed in the Codes table. The asterisk indicates that this static route is a candidate default route, which is why it is selected as the Gateway of Last Resort. The figure below illustrates the static default route from Router2 to exit interface Fast Ethernet 0/1.

How to configure Default Route 1

As you can see that the subnet mask in the routing table is /0; the subnet mask in a routing table determines how many bits must match between the destination IP address of the packet and the route in the routing table.

A binary 1 indicates that the bits must match. A binary 0 indicates that the bits do not have to match. A /0 mask in this route entry indicates that no one of the bits is required to match.

This route matches all packets for which a more specific match does not exist. Following is the video for the default static route configuration.