Introduction to BGP Backdoor

Introduction to BGP Backdoor

BGP is used to exchange routing information between multiple autonomous systems (AS) on the Internet. An autonomous system is a group of networks that share a common administrative area. 

BGP is used to route traffic across multiple independent systems and is the protocol used by Internet Service Providers (ISPs) to communicate routing information with one another.

⭐Related : BGP Cheat Sheet for Network Engineers
⭐Related : 51 facts about BGP routing Protocol for Network Engineers 

 What is BGP Backdoor ?

Routes learned from external routing protocol (eBGP) take preference over routes learned from internal routing protocols (EIGRP or OSPF) within a network. This is because of the reason as eBGP routes have a lower administrative distance (AD) than internal protocols which has higher AD.

The BGP backdoor feature allows you to make the path as backup path to the other path which is learned over the internal routing protocol. This makes the router prefer routes learned from internal protocols for that destination network, even though the external route might seem more reliable by default.

Generally in this case, the eBGP AD changed to 200, so that OSPF or EIGRP whose AD is 110 or 90 will be preferred over eBGP.

Let's take an example to understand more how it works in actual scenario. Lets take three routers connected to each other as shown below

BGP Backdoor
Fig 1.1- BGP Backdoor

So in our topology we have: 

  • Router R1 is connected to Router R2 with OSPF as routing protocol
  • Router R1 is connected to Router R3 with eBGP as routing protocol
  • Router R2 is connected to Router R3 with eBGP as routing protocol
So now, how (loopback) of Router R2 learned to Router R1 and R2 ?
Router R1 learned this route via OSPF connected to the router R2 and Router R3 learned this route via eBGP. 

But you also see that Router R1 learned the route (loopback) of Router R2 through R3 router using eBGP. R1 has two paths to learn the route (loopback) of Router R2, one is through R2 directly with OSPF AD-110 and from R3 eBGP with AD-20.

Since the eBGP learned route AD is 20 and the OSPF is 110, the eBGP route via R3 is the preferred one and is installed in the routing table. But if you see here the direct path is less preferred due to eBGP used on other path which may think of shortest path is not preferred while you learning the router from the longest path. What to do now ?

 Options to resolve issue- Two Options 

⭐1. Change the AD value of eBGP between Router R1 and Router R3 to 200, so that OSPF with AD 110 will be preferred over eBGP for the route 
⭐2. Use of BGP Backdoor on the Router R1 for that specific route

BGP Backdoor

⭐Option 1 : With option one which is not recommended at all, you can change the distance of eBGP protocol with the help of below command

R1# configure terminal
R1(config)# router bgp 100
R1(config-router)#neighbor remote-as 300
R1(config-router)#neighbor ebgp-multihop 255
R1(config-router)#neighbor update-source Loopback0
R1(config-router)#  distance 200 10
R1(config-router)# exit
⭐Option 2 : With second option, we are going to use BGP Backdoor option as shown below 

R1# configure terminal
R1(config)# router bgp 100
R1(config-router)neighbor remote-as 300
R1(config-router)# network backdoor
R1(config-router)# exit
Lets verify now how Router R1 is getting the routes in its routing table now : 

R1#sh ip route
Routing entry for
O [110/2] via, 00:01:13, Eth1
As you see now its learned through the OSPF between R1 and R2 instead of eBGP between R1 and R3. Hope it will clear the concept of BGP Backdoor.