Our objective is to prefer a IGP learned route instead of a eBGP learned route. As we all know that for the most part AD (Administrative distance) dictates what routes gets installed in the routing table.
Consider this simple topology and let's get started.
A brief overview of Administrative distance as used by Cisco routers.
Directly Connected Route - 0
Static route - 1
eBGP - 20
Internal EIGRP - 90
OSPF - 110
iBGP - 200
Now let's get started on the configurations. First let's get R2, R3, R4 interfaces configured.
- Assign an IP address to R2 Serial 1/0 interface.
- Assign an IP address to R2 Fast 2/0 interface.
- Assign an IP address to R2 Loopback 1.
- Assign an IP address to R3 Serial 1/1 interface
- Assign an IP address to R3 Fast 2/0 interface.
- Assign an IP address to R3 Loopback 1.
- Assign an IP address to R4 Serial 1/1 interface.
- Assign an IP address to R4 Serial 1/0 interface.
- Assign an IP address to R4 Loopback 1 interface.
- Create a new instance of BGP.
- Create the network statement to advertise the loopback into BGP.
- Redistribute connected so all routes can be propagated.
- Create the neighbor statement.
- Create a new instance of BGP.
- Create a network statement to advertise the loopback into BGP.
- Redistribute connected so all routes can be propagated.
- Create the neighbor statement for R3 and R2 routers.
- Create a new instance of BGP.
- Create a network statement to advertise the loopback into BGP.
- Create the neighbor statement.
Now that we are done with BGP, let's get OSPF (IGP) between R2 and R3.
- Create a new instance of OSPF.
- Get the network statements to advertise subnets and become neighbors.
Same as above. Finishing up the OSPF configurations.
Let's verify the routing table on R2. We should have all BGP learned routes in the routing table since BGP has a lower AD (Administrative Distance) than OSPF.
We know that we have a FASTETHERNET connection to between R3 and R2 and we are still using the slow path of R2 -> R4 -> R3 to get to R3's loopback. As you can see OSPF has the route for 3.3.3.3/32.
So how do we fix this?
We have 2 options:
- Adjusting bgp distance using bgp distance under bgp configuration *Not recommended*.
- Create a backdoor statement.
Let's look at BGP backdoor since the post is labelled backdoor.
Under bgp configuration type 'network <network to be snuck in through the backdoor> mask <netmask> <backdoor>'
So now that we are done with configuring backdoor for 3.3.3.3/32 let's check out R2's routing table again.
As you can see now the router immediately installs the OSPF learned route for 3.3.3.3/32 even though OSPF A/D is higher than the eBGP learned route.
Conclusion
Another easy to follow and a simple blogtorial. BGP backdoor is not very common, however they come in very handy when you trying to 'hack-up' something or have some strange technical constraint. I have used BGP backdoor one time in my networking career to rig up some VPN + eBGP + iBGP + OSPF + a single multihomed setup.
Configurations for all the routers on this lab can be found here.
Configurations for all the routers on this lab can be found here.
Please comment/subscribe/+1 if you find this article helpful as it definitely motivates me to write more articles especially at 1am in the morning.
Great post. I have used the backdoor command several times with great results.
ReplyDeleteThank you .. I try :) .. I have used it in a few scenarios as well.
Delete