9.3
Issues of Redundancy, Symmetry and Load Balancing
9.3.5 How to use statically set default routes
Many network administrators will choose to filter dynamically learned default routes to avoid situations where traffic ends up where it is not supposed to be, and set their own internal default route statically. Statically set defaults typically provide more control over routing within an AS.

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 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.

It's very dangerous to point a static route out a broadcast interface, since the router will ARP for every address within the default address range, expecting the next hop to answer the ARP. This can lead to extremely large ARP table, and even result in the router crashing, or failing to route packets altogether.

A system can also set its default based on some network number it learns from another system. In Figure , 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.

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 (as close to the Internet) as possible so that they are more representative of the as much of the path to the Internet backbone as possible. This is important if the AS you are connected to has a single connection to the Internet backbone. 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 Internet backbone..

Multiple static defaults can be used at the same time. One way to set multiple static defaults is to point to a network learned through multiple connections and establish a degree of preference by using the local preference attribute. This would apply to a single router connected to the provider via multiple connections, or multiple routers running IBGP inside the AS. Both scenarios are illustrated in Figure . These are similar to the scenarios you saw earlier, the only difference being that the customer is setting its own default rather than relying on the provider to send the 0/0 default route. In this example, the customer will choose 128.213.0.0/16 with the local preference of 100 via the upper link. The lower link will be used as backup in case of failure in the primary link.

Another way of setting defaults statically involves using the Cisco administrative distance parameter to establish a degree of preference. This would work only in the case of one router connected to multiple connections because the distance parameter is not exchanged between routers.

If two static default entries are defined with different distances, the default with the lowest distance wins. If the better default goes away, the second default becomes available. If both defaults have the same distance, then traffic will be balanced between the two defaults.

Figure illustrates the use of the distance parameter in setting multiple defaults. AS1 is connected to AS2 via two links and is setting its own defaults toward AS2. AS1 uses one link as primary by giving the static default a distance of 50, lower than the distance of 60 given to the backup link. If the primary link fails, traffic will shift toward the backup.