This article help you to understand how Backdoor option works in BGP. Generally, Backdoor is a term which technically describes – Bypassing security mechanism to access a Resources. But in BGP it refers to a different thing.
Before understanding the BGP Backdoor, We need to understand some Routing Concept and Protocols.
BGP is a routing protocol used to route between Autonomous Systems. BGP has no Aim to ensure prefix connectivity, this is the role of IGP (internal routing protocols like OSPF, EIGRP or RIP).Several Routing Protocols are used to Update routing table with routing information(unknown routes).But a challenge is, what happen if the same Network is advertised through multiple routing protocols?
Here,where Administrative Distances(AD) are Comes into play,this Value helps to place Routes by giving preference or priority to a Routing Protocols,always Least AD value is Preferred.
In the same time the Administrative Distance of external BGP(eBGP) = 20, better than any other IGP because BGP is the master of inter Autonomous system routing.
Understand the Topology of BGP Backdoor.
In the above topology,there are two protocols are enabled to exchange Routing information (i.e) OSPF and BGP
Now at R2, a network admin advertised a route 18.104.22.168/24 via OSPF and BGP,on R3 router if you check the Routing table there is single route for 22.214.171.124/24..can you guess Via which Protocol it is?
Yes,Its is BGP(eBGP) you know why..based on least AD value it chooses.but why i have to jump one AS to reach 126.96.36.199/24 instead of a direct link between R3 and R2 router Via OSPF protocol.
To achieve this,Two ways are there
1.Manually raise the AD value of BGP to give Priority for OSPF, else go with 2nd
2.Use Backdoor Command in BGP
when you configure BGP backdoor for a Network then it increases AD value to 200 automatically and IGP protocols are Preferred and injected into the routing table.
At R3 router use the command,
R3(config)#Router Bgp 65535
R3(config-router)#Network 188.8.131.52 mask 255.255.255.0 Backdoor
Then refresh the Routing table and check a routing table,now OSPF route is prefered.
To refresh Routing Table use the command..
R3#Clear ip route *