7.4.2 Static and Default Route Command List
7.4.2 Static and Default Route Command List
Listed below are several situations when you might want to configure static routes:
To configure a default route or a route out of a stub network (a stub network is one that
has a single route into and out of the network)
For small networks that do not change very often and that have only a few networks
To turn off all routing protocols and reduce traffic or improve security
A default route is a route that is considered to match all destination IP addresses. With a default
route, when a packet's destination IP address does not match any other routes, the router uses
the default route for forwarding the packet. Be aware of the following default route details:
Default routes work best when only one path exists to a part of the network.
One default route in the routing table could replace hundreds of static route entries in
the routing table.
When the default route is not set, the router discards packets that do not match a route
in the routing table.
The following table lists the commands for configuring static routes:
Command Action
Configuring a static route to network 0.0.0.0 with mask of 0.0.0.0 is the most common method
of configuring a default gateway. However, the following methods can also be used under
certain circumstances:
Use the ip default-network command to designate a route already in the routing table
as the default route. For example, if the router had learned of network 10.0.0.0/8
through a routing protocol, you could use the following command to designate that
network as the default network:
ip default-network 10.0.0.0
Be aware that the ip default-network command only makes a route a candidate for the
default route, it does not necessarily guarantee that the route will be used to route packets
to unknown destinations.
Use the ip default-gateway command if IP routing has been disabled on the router.
With IP routing disabled, routes will not be learned through a routing protocol, nor will
static routes be used if configured. With IP routing enabled, the ip default-
gatewaysetting will not be used.
The following command creates a static route to network 192.168.1.0 through the router with
the IP address 192.168.1.35 and gives it an administrative distance value of 25:
The following command identifies a default route through an interface with address 10.1.1.2: