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. Figure 11-5 illustrates the topology for this example.
In Figure 11-5, AS2 is running an IGP (OSPF) on the private link between it and AS1, and it 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.
Looking at RTC's IP routing table in Example 11-27 reveals that prefix 192.68.10.0/24 is indeed learned via BGP. RTC will take the longer path via AS3 (next hop 172.16.20.2) to reach 192.68.10.0/24. Note the distance of [20] that the EBGP route has.
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
|
If you wanted to have RTC prefer the OSPF entry, you would configure RTC as demonstrated in Example 11-28.
router bgp 1 neighbor 172.16.20.2 remote-as 3 network 192.68.10.0 backdoor no auto-summary |
In Example 11-28, 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 will not cause BGP to generate an advertisement for that network.
The output generated in Example 11-29 shows RTC's new routing table. 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
|