Static Routes

Static routes are routes you assign in the router configuration. These routes don't change until you reconfigure them yourself. You might ask, "Why not just use static routes and forget all this routing stuff?" Well, if all you had were static routes and something changedperhaps you had to add another subnet, or you changed your Internet service provideryou would have to reconfigure every router to conform to the network changes. It would be impossible to react to short-term changes, such as equipment failures, in all but the simplest networks.

Static routes do have their place in a modern network. They are appropriate for default routes, routes to the null interface, routes to stub networks, and other situations in which the possibility of change is minimal.

To define a static route to network via the router, you would use the command:

ip route


8.4.1. Default Static Routes

Static routes are commonly used for the default route. A default route is used when a router does not have a specific route to a certain address. The Internet gateway is always a good default route. For example, if our gateway router's IP address is, our default route might look like this:

ip route

On the gateway router, the static route could point to the interface that is connected to the Internet:

ip route serial 0

The route establishes a default only for the current router and the RIP routing protocol. Other routing protocols, such as IGRP and EIGRP, can learn a default route either from another protocol or from an explicit ip default-network command. This command tells IGRP and EIGRP to distribute the default route to other routers. To create a default network, use the ip default-network command. This route is usually created in tandem with the route for completeness, as in this example:

! Define the default route for this router
ip route
! Define the default network
ip default-network


8.4.2. A Static Route to the Null Interface

A static route can be used in conjunction with the null interface to filter unwanted traffic. If we want to drop traffic to the network, we can add a command like this to our router's configuration:

ip route null0

This command defines a route for the network to the null interface. The null interface discards all incoming traffic. This method of disposing of unwanted traffic is much more efficient than using an access list.

8.4.3. Backup Static Routes

Static routes are often used to create backup routes that come into effect when a communications link fails. To create backup static routes , you need to use the administrative distance option to the ip route command.

Normally, static routes have an administrative distance of 1, which means they are used in preference to routes learned from a routing protocol. (See Table 8-1 for a complete list of administrative distances.) This isn't how we want a backup route to behave: we want it to be used only as a last resort. Therefore, our backup route should have a higher administrative distance than our primary routes.

Let's assume that our routing protocol is RIP, which has an administrative distance of 120. We want to assign the backup route an administrative distance that's higher than the routing protocol'swe'll choose 125. Here is a configuration with a backup static route to being redistributed into RIP:

! Define our backup static route with a distance of 125
ip route 125
! Configure the RIP information
router rip

Notice that we are not advertising our backup static route through RIP. (There is no redistribute command.) As a general rule, backup static routes should not be advertised; you'll want to use them only when the routes learned from the dynamic routing protocol (RIP, in this case) are unavailable.

For more information on redistributing routing information, see "Route Redistribution" later in this chapter.

Cisco IOS in a Nutshell
Cisco IOS in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596008694
EAN: 2147483647
Year: 2006
Pages: 1031
Authors: James Boney
Simiral book on Amazon © 2008-2017.
If you may any questions please contact us: