A single link can exist between two ASes to exchange data without advertising it to other ASes. In this case, adding network 192.1.12.2 backdoor on the routers at both ends of the link makes it a backdoor route.
1. The backdoor route attribute causes the router to prefer routes learned from IGP over routes learned from an IBGP neighbor. By default, EBGP routes have an Administrative Distance (AD) of 20, which is always preferred over IGP routing protocols with other AD values. The backdoor route is used in special scenarios to raise the priority of IGP routes above EBGP. Let鈥檚 examine a special case below.
2. Routes redistributed into OSPF: R5 and R3 will learn an IGP route from R4, while R5, as an IBGP neighbor of R4, will also learn an IBGP route. Due to the higher administrative distance of IBGP routes, this has no impact on path selection on R5. However, R3 will learn an EBGP route from R5 and simultaneously receive an IGP route from R4. In this situation, R3 sets the next-hop for 199.172.0.0 to R5, creating a routing loop. The solution is to append the backdoor parameter to the neighbor command on R5 and R3: neighbor ip-address backdoor.
3. The root cause of this phenomenon is the next-hop attribute when BGP learns routes. The default next-hop rules are as follows: locally originated routes have a next-hop of 0.0.0.0; routes received from EBGP have their next-hop changed to the EBGP peer鈥檚 IP address; and when advertising to IBGP, the next-hop value is not modified. However, you can modify this rule using next-hop-self to advertise the next-hop address as oneself to IBGP peers.
Alternatively, you can use next-hop-unchanged to prevent the next-hop value from being modified after receiving an EBGP route. For example, the loop issue above can also be resolved by configuring next-hop-unchanged on R5 and R4. For the next-hop attribute, you can also use a route-map to make changes.
4. Injection Conditions: For a typical topology, AS100 follows the best-exit principle. The configuration methods are as follows:
(1) MED: Set MED on AS200 so AS100 can recognize it.
(2) AS-Path Prepend: R4 advertises the 2.0 route to R2 with a prepended AS-path; do the same for R5.
(3) Use conditional route injection.
5. First, on the left side, AS300 has a more specific route for 172.16.1.0/24. Within AS100, the 172.16.0.0/16 route received normally might not take the optimal path via R2-R4, possibly going through the R3-R5 EBGP path instead. The meaning of conditional route injection (bgp inject-map route-map-name exist-map route-map-name) is as follows:
(1) When the BGP table of R2 contains the 172.16.0.0/16 BGP route and the next-hop update source is 192.168.24.4 (R4), forcibly inject a more specific 172.16.1.0/24 BGP route into your AS100 IBGP.
(2) The IBGP route selection on R1 will change. It will receive both 172.16.0.0/16 and 172.16.1.0/24 from R2 and R3, but based on the longest-match rule, it will choose the 172.16.1.0/24 advertised by R2 to reach AS300. The overall invocation process can be understood as: match the entries defined by the second route-map (172.16.0.0/