Pages

Wednesday, January 19, 2011

BGP conditional injection

.
Aggregation of the BGP route is useful to minimize the number of routers in the routing table. However, in some cases we want to have a control over specific route before aggregation. We can use BGP conditional injection to do this. 

This command allows us to inject more specific route and advertise to its BGP neighbors when it receives the aggregate route from the upstream router. The command is "bgp inject-map  exist-map".

Here is the example. 
- R2 advertise aggregate route of 10.0.0.0/8  to R1.
- R1 needs to advertise more specific route to R3 if it receives 10.0.0.0/8 from R2. 
- When R1 has 10.0.0.0/8 in its routing table, it will inject 10.1.1.0/24 in the BGP network and advertise to R3.




Configuration

R1

router bgp 100
 no synchronization
 bgp log-neighbor-changes
 bgp inject-map INJECT exist-map EXIST
 neighbor 192.168.1.2 remote-as 200
 neighbor 192.168.2.2 remote-as 100
 no auto-summary
!
ip forward-protocol nd
!
!
ip http server
no ip http secure-server
!
ip prefix-list EXIST seq 5 permit 10.0.0.0/8
ip prefix-list INJECT seq 5 permit 10.1.1.0/24
ip prefix-list SOURCE seq 5 permit 192.168.1.2/32
!
!
!
route-map INJECT permit 10
 set ip address prefix-list INJECT
!
route-map EXIST permit 10
 match ip address prefix-list EXIST
 match ip route-source prefix-list SOURCE
!
!



Verify the configuration

When  R1 does not have 10.0.0.0/8 in its BGP table.

R1#sh ip bgp

R1#

----------------------------------


When  R1 has 10.0.0.0/8 in its BGP table, it will inject and advertise 10.1.1.0/24 to R3
We can see R1 originated the 10.1.1.0/24 network to the BGP process since it has "?" in the path.

R1#sh ip bgp
BGP table version is 9, local router ID is 192.168.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 10.0.0.0         192.168.1.2              0             0 200 i
*> 10.1.1.0/24      192.168.1.2                            0 ?
R1#

No comments:

Post a Comment