Previous Table of Contents Next


Statically Set Defaults

Instead of dynamically learning the 0/0 default, a router can set its own default statically. This is illustrated in figure 11-2. RTC is using the following command:

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


Figure 11-2  Dealing with 0/0 default.

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.

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

RTC configuration:

    router bgp 1
    network 192.68.11.0
    neighbor 172.16.20.2 remote-as 3
    neighbor 192.68.6.1 remote-as 2
    no auto-summary
    ip route 0.0.0.0 0.0.0.0 193.78.0.0

The following BGP 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).

    RTC#show ip bgp
    BGP table version is 8, local router ID is 192.68.11.1
    Status codes: s suppressed, d damped, h history, * valid, > best,
    i - internal Origin codes: i - IGP, e - EGP, ? - incomplete

    Network         Next Hop     Metric LocPrf Weight Path
    *> 192.68.11.0    0.0.0.0           0     32768 i
    *> 193.78.0.0/16  172.16.20.2                 0 3 7 6 i
    *                 192.68.6.1                 0 2 7 6 i

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

    RTC#show ip route
    Codes: C - connected, S - static, I - IGRP, R - RIP,
    M - mobile, B - BGP
      D - EIGRP, EX - EIGRP external, O - OSPF,
      IA - OSPF inter area
      E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
      i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2,
      * - candidate default U - per-user static route

   Gateway of last resort is 193.78.0.0 to network 0.0.0.0

   C  192.68.6.0/24 is directly connected, Ethernet0/1
   C  192.68.11.0/24 is directly connected, Ethernet0/0
   B  193.78.0.0/16 [20/0] via 172.16.20.2, 00:32:32
   C    172.16.20.0/24 is directly connected, Serial2/1
   S*  0.0.0.0/0 [1/0] via 193.78.0.0

In case 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. This is illustrated in the following:

RTC configuration:

    router bgp 1
    network 192.68.11.0
    neighbor 172.16.20.2 remote-as 3
    neighbor 192.68.6.1 remote-as 2
    no auto-summary

    ip route 0.0.0.0 0.0.0.0 172.16.20.2 40
    ip route 0.0.0.0 0.0.0.0 192.68.6.1 50

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 make sure that the route is preferred. In case the route to 172.16.20.2 goes away, the static entry will go with it, and the second entry will kick in. The following shows the output of RTC's routing table.

    RTC#show ip route
    Codes: C - connected, S - static, I - IGRP,
    R - RIP, M - mobile, B - BGP
      D - EIGRP, EX - EIGRP external, O - OSPF,
      IA - OSPF inter area
      E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
      i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2,
      * - candidate default U - per-user static route

    Gateway of last resort is 172.16.20.2 to network 0.0.0.0

    C  192.68.6.0/24 is directly connected, Ethernet0/1
    C  192.68.11.0/24 is directly connected, Ethernet0/0
    B  193.78.0.0/16 [20/0] via 172.16.20.2, 00:45:08
    C    172.16.20.0/24 is directly connected, Serial2/1
    S*  0.0.0.0/0 [40/0] via 172.16.20.2

The following shows the same output in case the link between RTC and RTA goes down:

    RTC#show ip route
    Codes: C - connected, S - static, I - IGRP,
      R - RIP, M - mobile, B - BGP
      D - EIGRP, EX - EIGRP external, O - OSPF,
      IA - OSPF inter area
      E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
      i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2,
      * - candidate default U - per-user static route

    Gateway of last resort is 192.68.6.1 to network 0.0.0.0

    C  192.68.6.0/24 is directly connected, Ethernet0/1
    C  192.68.11.0/24 is directly connected, Ethernet0/0
    B  193.78.0.0/16 [20/0] via 192.68.6.1, 00:01:14
    S*  0.0.0.0/0 [60/0] via 192.68.6.1

Note how the second static entry with distance 60 has now kicked in.

Multihoming to a Single Provider

For the case where one customer has multiple connections to the same provider, we will look at implementation examples that cover the following:

  Default only, one primary, and one backup link
  Default, primary, and backup plus partial routing
  Automatic load balancing


Previous Table of Contents Next