Previous Table of Contents Next


The preceding configuration shows a route map PREF_FROM_AS2, which sets all updates coming from AS2 with a local preference of 200. The other route map PREF_FROM_AS3 sets all updates coming from AS3 that have AS2 in them with a local preference of 100; all other updates will have a local preference of 300. Note the regular expression _2_, which indicates routes that have passed via AS2. With this configuration, all networks that originated from AS2 or customers of AS2 will be reachable directly via the private link. All other routes will be reachable via the provider AS3. The following is RTC's BGP table:

    RTC#show ip bgp
    BGP table version is 11, 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
    *> 172.16.1.0/24  172.16.20.2     0   300    0 3 i
    *            192.68.6.1          200      0 2 3 i
    *> 172.16.10.0/24 172.16.20.2     20  300    0 3 i
    *            192.68.6.1          200      0 2 3 i
    *> 172.16.65.0/26 172.16.20.2     20  300    0 3 i
    *            192.68.6.1          200      0 2 3 i
    *> 172.16.220.0/24  172.16.20.2    0    300      0 3 i
    *            192.68.6.1          200      0 2 3 i
    * 192.68.10.0       172.16.20.2          100      0 3 2 i
    *>        192.68.6.1  0       200      0 2 i
    *> 192.68.11.0      0.0.0.0   0       32768 i
    *> 192.68.40.0      172.16.20.2       300      0 3 6 i
    *           192.68.6.1             200      0 2 3 6 i

Note that prefix 192.68.10.0/24 coming from AS3 has a local preference of 100 because its AS_path 3 2 contains 2. All other routes coming from AS3 have a local preference of 300.

Customers of Different Providers with a Backup Link

Providers prefer to use as little configuration as possible when dealing with adding and removing customers. Every time a customer is added or removed, the provider will have to add policies to accommodate the customer's requirement. In the following examples, we will show how an AS can use the community attribute or path manipulation techniques in such a way that a new customer can have the provider dynamically set the customer's policies.

The Community Approach

In figure 11-9, customer AS1 is getting its service from provider AS4. Customer AS2 is getting its service from provider AS3. AS1 and AS2 have a private link that will be used for internal use between the two ASs. For all other traffic, both customers would like to go out via their direct providers, AS1 via AS4 and AS2 via AS3. In case the private link goes down, the customers should be able to talk to one another via the providers. If a link to the provider fails, the other customer should be used to reach the Internet.


Figure 11-9  Multiple ASs with multiple providers.

The following is the relevant configuration of RTA, RTF, and RTC. RTD should be a mirror image of RTC.

RTA configuration:

    router bgp 4
    network 172.16.220.0 mask 255.255.255.0
    neighbor 172.16.1.2 remote-as 3
    neighbor 172.16.1.2 route-map CHECK_COMMUNITY in
    neighbor 172.16.20.1 remote-as 1
    neighbor 172.16.20.1 route-map CHECK_COMMUNITY in
    no auto-summary

    ip community-list 2 permit 4:40
    ip community-list 3 permit 4:60

    route-map CHECK_COMMUNITY permit 10
    match community 2
    set local-preference 40

    route-map CHECK_COMMUNITY permit 20
    match community 3
    set local-preference 60

    route-map CHECK_COMMUNITY permit 30
    set local-preference 100

Note how RTA has configured the route map CHECK_COMMUNITY. The match community value statement under the route map corrolates with the ip community-list value list, which states the following:

  Instance 10: For routes with community 4:40, set the local preference to 40.
  Instance 20: For routes with community 4:60, set the local preference to 60.
  Instance 30: For all other routes, set the preference to 100.

RTC configuration:

    router bgp 1
    network 192.68.11.0
    neighbor 172.16.20.2 remote-as 4
    neighbor 172.16.20.2 send-community
    neighbor 172.16.20.2 route-map setcommunity out
    neighbor 172.16.20.2 filter-list 10 out
    neighbor 192.68.6.1 remote-as 2
    no auto-summary

    ip as-path access-list 2 permit _2_

    ip as-path access-list 10 permit ^$
    ip as-path access-list 10 permit ^2$

    route-map setcommunity permit 10
     match as-path 2
     set community 4:40

    route-map setcommunity permit 20

Note the route map "setcommunity," which is configured toward AS4. The route map states the following:

  Instance 10: For all routes that have passed via AS2 (_2_), set the community to 4:40.
  Instance 20: All other routes will go through and do not have any community set.

RTC also has a "filter-list 10 out," which prevents AS4 from learning about AS3 via AS1. The filter list only permits AS1 and AS2 routes. In case the link between AS4 and AS3 goes down, AS4 cannot use AS1 to reach AS3.

RTF configuration:

    router bgp 3
    network 172.16.10.0 mask 255.255.255.0
    network 172.16.65.0 mask 255.255.255.192
    neighbor 172.16.1.1 remote-as 4
    neighbor 172.16.1.1 send-community
    neighbor 172.16.1.1 route-map setcommunity out
    neighbor 192.68.5.2 remote-as 2
    no auto-summary

    route-map setcommunity permit 10
    set community 4:60

In RTF, the route map, setcommunity neighbor command sets all updates toward AS4 with a community of 4:60.

Consider RTA's BGP table to see what we have achieved.

    RTA#show ip bgp
    BGP table version is 7, local router ID is 172.16.2.254
    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
    *> 172.16.10.0/24   172.16.1.2     0  60    0 3 i
    *> 172.16.65.0/26   172.16.1.2     0  60    0 3 i
    *> 172.16.220.0/24  0.0.0.0        0    32768 i
    *> 192.68.10.0     172.16.1.2         60    0 3 2 i
    *              172.16.20.1            40   0 1 2 i
    *> 192.68.11.0      172.16.20.1     0   100   0 1 i

RTA has dynamically set the local preference for all routes from the provider AS3 to 60. All routes coming from AS2 via AS1 have a preference of 40, and routes local to AS1 have a preference of 100.


Previous Table of Contents Next