Previous Table of Contents Next


Overlapping Protocols: (Backdoors)

This example shows how the backdoor command can be used to change the EBGP distance to have IGP routes favored over EBGP routes for specific network numbers.

In Figure 10-5, AS2 is running an IGP (OSPF) on the private link between it and AS1, and is running EBGP with AS3. RTC, in AS1, will receive advertisements about 192.68.10.0/24 from AS3 via EBGP with a distance of 20 and from AS2 via OSPF with a distance of 110. Because the lower distance is preferred, RTC will use the BGP link to AS3 to reach 192.68.10.0/24.


Figure 10-5  BGP backdoor routes.

Looking at RTC's IP routing table, you see the following:

  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 not set
    C    192.68.6.0/24 is directly connected, Ethernet0/1
    B    192.68.10.0/24 [20/0] via 172.16.20.2, 00:21:36
         172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
    C       172.16.20.0/24 is directly connected, Serial2/1
    B       172.16.1.0/24 [20/0] via 172.16.20.2, 00:21:37
    B       172.16.65.0/26 [20/20] via 172.16.20.2, 00:21:37

Prefix 192.68.10.0/24 is indeed learned via BGP. RTC will take the longer path via AS3 (next hop 172.16.0.2) to reach 192.68.10.0/24. Note the distance of [20] that the EBGP route has. If you wanted to have RTC prefer the OSPF entry, you would configure RTC in the following way:

RTC configuration:

    router bgp 1
      neighbor 172.16.20.2 remote-as 3
      network 192.68.10.0 backdoor
      no auto-summary

The preceding configuration, "network 192.68.10.0 backdoor," changes the distance of the BGP route 192.68.10.0/24 from 20 to 200, which makes the OSPF route with a distance of 110 more preferred. Note that "network 192.68.10.0 backdoor" entry will not cause BGP to generate an advertisement for that network.

Following is the new routing table of RTC. Note that the 192.68.10.0/24 entry is now learned via OSPF with distance [110], and the private link between AS1 and AS2 will be used.

   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 not set
    C    192.68.6.0/24 is directly connected, Ethernet0/1
    O IA 192.68.10.0/24 [110/20] via 192.68.6.1, 00:00:21, Ethernet0/1
         172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
    C       172.16.20.0/24 is directly connected, Serial2/1
    B       172.16.1.0/24 [20/0] via 172.16.20.2, 00:29:07
    B       172.16.65.0/26 [20/20] via 172.16.20.2, 00:29:07

BGP Attributes

In this section, we will work with the network topology illustrated in figure 10-6 to demonstrate how the different BGP attributes are used.


Figure 10-6  Applying BGP attributes.

Following is a first run of basic configuration for routers RTA, RTF, RTC, and RTD, illustrated in figure 10-6. Additional configuration will be added according to the topic under discussion.

RTA configuration:

    ip subnet-zero

    interface Loopback0
     ip address 172.16.2.254 255.255.255.255

    interface Ethernet0
     ip address 172.16.220.1 255.255.255.0

    interface Ethernet1
     ip address 172.16.1.1 255.255.255.0

    interface Serial0
     ip address 172.16.20.2 255.255.255.0

    router ospf 10
     passive-interface Serial0
     network 172.16.0.0 0.0.255.255 area 0

    router bgp 3
     no synchronization
     network 172.16.1.0 mask 255.255.255.0
     network 172.16.10.0 mask 255.255.255.0
     network 172.16.65.0 mask 255.255.255.192
     network 172.16.220.0 mask 255.255.255.0
     neighbor 172.16.1.2 remote-as 3
     neighbor 172.16.1.2 update-source Loopback0
     neighbor 172.16.20.1 remote-as 1
     neighbor 172.16.20.1 filter-list 10 out
     no auto-summary
    
    ip classless
    ip as-path access-list 10 permit ^$

RTF configuration:

    ip subnet-zero

    interface Ethernet0/0
     ip address 172.16.10.1 255.255.255.0

    interface Ethernet 1/0
     ip address 172.16.65.1 255.255.255.192

    interface Ethernet1/1
     ip address 172.16.1.2 255.255.255.0

    interface Serial2/1
     ip address 192.68.5.1 255.255.255.0

    router ospf 10
     network 172.16.0.0 0.0.255.255 area 0

    router bgp 3
     no synchronization
     network 172.16.1.0 mask 255.255.255.0
     network 172.16.10.0 mask 255.255.255.0
     network 172.16.65.0 mask 255.255.255.192
     network 172.16.220.0 mask 255.255.255.0
     neighbor 172.16.2.254  remote-as 3
     neighbor 172.16.2.254 next-hop-self
     neighbor 192.68.5.2 remote-as 2
     neighbor 192.68.5.2 filter-list 10 out
     no auto-summary

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

RTC configuration:

    ip subnet-zero

    interface Ethernet0/0
     ip address 192.68.11.1 255.255.255.0

    interface Ethernet0/1
     ip address 192.68.6.2 255.255.255.0

    interface Serial2/1
     ip address 172.16.20.1 255.255.255.0

    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 classless

RTD configuration:

    ip subnet-zero

    interface Ethernet1/0
     ip address 192.68.10.1 255.255.255.0

    interface Ethernet1/1
     ip address 192.68.6.1 255.255.255.0

    interface Serial0/0
     ip address 192.68.5.2 255.255.255.0

    router bgp 2
     network 192.68.10.0
     neighbor 192.68.5.1 remote-as 3
     neighbor 192.68.6.2 remote-as 1
     no auto-summary

    ip classless


Notes:  
AS3 is assumed to be a nontransit AS. This is why filter-list 10 is applied to force AS3 to originate its local routes only. Routes learned from AS1 or AS2 will not be propagated outside the AS. Also note that some networks such as 172.16.10.0/24 are advertised via the network command on both RTA and RTF. This will ensure that a link failure between AS3 and either AS1 or AS2 will not prevent such networks from being advertised.


Previous Table of Contents Next