9.3
Issues of Redundancy, Symmetry and Load Balancing
9.3.6
Configuration example: statically set default routes
Instead of dynamically learning the 0/0 default, a router can set its own default statically. This is illustrated in the figure.

ip route network [mask] {address | interface} [distance]

The 0/0 static route can point to a network number, a gateway address, or to a physical interface as being the default path. The distance is a means of giving preference to the static route in case multiple entries for the same network exist. Routes with a lower distance are preferred over routes with a higher distance.

Note: Click on topology to view command outputs.

The configuration shows how RTC can set the default to point toward network 193.78.0.0/16.

The table of RTC shows that 193.78.0.0/16 has been learned via two paths -- the first via AS3 and the second via AS2. BGP has preferred the first path as being the best (BGP attributes can be used to influence which path BGP will use and hence influence the default path).

The IP table of RTC shows how the gateway of last resort has been set to follow network 193.78.0.0/16. Recursive lookup in the IP routing table shows that 193.78.0.0/16 can be reached via 172.16.20.2, which is RTA.

If you do not want to follow a single route, you can still use the ip route 0.0.0.0 0.0.0.0 command to point to multiple networks or IP addresses. The distance keyword will give you the ability to prefer one default over the other.

Note how RTC is pointing to two different IP addresses. These could also have been two different network numbers that exist in the IP routing table. The "distance" 40 of the first static route will ensure that the route is preferred. If the route to 172.16.20.2 goes away, the static entry will go with it, and the second entry will kick in. Note the output of the RTC routing table.

RTC#show ip route shows the same output if the link between RTC and RTA goes down. Note how the second static entry with distance 60 has now kicked in.