BGP Route Injection

I decided to take a break from studies to write a good blog about an interesting BGP feature, Route Injection. Assuming you have an aggregated route being received from 2 of your ISP you peer with and you’d want to split routing towards those routes between your 2 connections. So simplicity sake for a /24 route, we’d want to break that up into 2 /25 where the first half would go through ISP 1 and the second half would route through ISP 2. This is where route injection can be helpful.

I would need 3 prefix-list I would call them SPECIFIC, AGGREGATE and SOUCE.

ip prefix-list SPECIFIC permit 192.168.1.0/25
ip prefix-list AGGREGATE permit 192.168.1.0/24
ip prefix-list SOURCE permit 10.10.12.2/32

SPECIFIC would pertain to the more specific route that I wanted to re-route to the other ISP. AGGREGATE would be the summarized route I received from my 2 ISPs. SOURCE is the ip address basically of the other ISP where I would want to advertise to more specific route to.

Next we would need to create 2 route-maps. INJECT-MAP and EXIST-MAP

route-map INJECT-MAP permit 10
set ip add prefix-list SPECIFIC
!
route-map EXIST-MAP permit 10
match ip add prefix-list AGGREGATE
match ip route-source SOURCE
!

First route map specifies the BGP route to be injected in the table while the second one matches the summarized route we are receiving from the ISPs. The second match statement specifies where we are supposed to receive the more specific route set in the INJECT-MAP route-map.

Lastly we will apply this to our BGP config.

router bgp 100
bgp inject-map INJECT-MAP exist-map EXIST-MAP
!

The really annoying bit about labbing this and using BGP is that it takes tooooo long to update. I can just imagine taking the CCIE lab waiting and uncertain if I have to wait a bit longer or it just wasn’t configured correctly. With this lab, eventually it will come up.

To verify, if you do a show ip bgp 192.168.1.0 255.255.255.128. You should expect that this would show that the best path would be the ISP who’s IP address we specified in our SOURCE prefix-list.

[ISP 1]
          \
            \
              \
                \
                [SITE]
                /
              /
            /
          /
[ISP 2]
Figure 1. Learning aggregated route 192.168.1.0/24 from 2 ISPs.

Note: This is what happens when you start reading RFCs 🙂

Advertisements