Previous Table of Contents Next


Setting Default Routes

Following defaults is a powerful technique in minimizing the amount of routes a router has to learn and providing networks with redundancy in the event of failures and connectivity interruptions. Cisco calls the default path the gateway of last resort. It is important to understand how default routing works, although it makes life easier when configured correctly; life is more difficult when routing is configured incorrectly.

By definition, a default route is a route in the IP forwarding table that is used if a routing entry for a destination does not exist. In other words, a default route is a last resort in case specific route information for a destination is unknown.

Dynamically Learned Defaults

The universally known default route is usually represented by the network mask combination 0.0.0.0/0.0.0.0 (also represented as 0/0). This route can be exchanged as a dynamic advertisement between routers. Any system advertising this route will be representing itself as a gateway of last resort for other systems. Figure 6-2 illustrates such an advertisement.


Figure 6-2  Dynamic default advertisement.


Troubleshooting:  
Ch. 11, pp. 368-373. Dynamically Learned Defaults

Dynamic defaults (0/0) can be learned via BGP or via IGP, depending on what protocol is running between two domains. For redundancy purposes and to accommodate potential failures, you should be receiving defaults from multiple sources. In the context of BGP, the local preference can be set for the default to give a degree of preference over which default is primary and which is backup. If one default goes away, the other will take its place.

In the left instance of figure 6-2, a single router is connecting AS1 to AS2 via two connections. If AS1 chooses to accept as few routes as possible from AS2, AS1 can accept only the 0/0 default route. In this example, AS1 is learning 0/0 from two links and giving preference by setting the local preference to 100 on the primary link and 50 (or any number smaller than 100) on the backup link. This would set the gateway of last resort to 1.1.1.1.

In the multiple routers scenario (right instance of figure 6-2), the same behavior can be achieved with multiple routers as long as IBGP is running inside the AS. Local preference, which is exchanged between routers, will determine the primary and backup links.

Statically Set Defaults

It is also possible for an AS to statically set its own defaults by setting its own 0/0 route. Statically set defaults provide more control over routing behaviors because the operator has the option of defining his last resort rather than it being forced on him by some outside entity. Many operators choose to filter dynamically learned defaults to avoid situations where traffic ends up where it is not supposed to be.


Troubleshooting:  
Ch. 11, pp. 370-373. Statically Set Defaults

An operator can statically set the default route 0/0 to point to the following:

  The IP address of the next hop gateway
  A specific router interface
  A network number

Figure 6-3 illustrates the first two possibilities. On the left, a router is statically pointing its own 0/0 default toward the IP address 1.1.1.1. On the right, the same router is pointing its default toward an Ethernet interface. In the latter approach, further processing is needed to figure out to whom on the segment the traffic should be sent. Such processing usually involves sending Address Resolution Protocol (ARP) packets to identify the physical address of the next hop router.


Figure 6-3  Statically set defaults.

A system can also set its default based on some network number it learns from another system. In figure 6-4, AS1 is dynamically learning route 192.213.0.0/16 from AS2. If AS1 points its default to 192.213.0.0/16, that network will automatically become the gateway of last resort. This approach uses recursive route lookup to find the IP address of the next hop gateway. In this example, the recursive lookup will determine that 192.213.0.0/16 was learned via the next hop 1.1.1.1, and traffic would be directed accordingly.


Figure 6-4  Pointing default toward a network number.

It is important for defaults to disappear dynamically if what they point to disappears. Cisco enables a statically defined default to follow the existence of the entity to which it is pointing. If the default, for example, is pointing to a network number and that network is no longer reachable (does not show in the IP routing table), the default will also disappear from the IP routing table. This behavior is needed in situations where multiple defaults exist. One default can be used as primary and others as a backup in case the primary default is no longer valid.

Default networks should be selected as far upstream (closer to the Internet) as possible so that they are more representative of the whole link toward the NAP rather than a portion. This is important if the AS you are connected to has a single connection toward the NAP. In figure 6-4, AS1 can set the default toward its provider AS2 by pointing to prefix 128.213.11.0/24 or the supernet 192.213.0.0/16. Pointing the default to 128.213.11.0/24 makes it dependent on the stability of a portion of the link (AS1 to AS2) and not the whole link (AS1 to AS3) toward the NAP. If the link between AS2 and AS3 goes down, AS1 would be still sending traffic toward AS2 rather than directing it to some other default (assuming that AS1 has other providers). A better default choice would be the supernet, 192.213.0.0/16, because its existence is more representative of the whole link toward the NAP and is no longer dependent on any intervening links.


Troubleshooting:  
Setting and selecting reliable defaults.

Selected default networks should not be specific subnets. A subnet that is flip-flopping might cause your default to come and go constantly. It is much better to point the default to a major aggregate or supernet that reflects the stability of a whole provider rather than a particular link.


Previous Table of Contents Next