Showing results for 
Search instead for 
Did you mean: 
Join Customer Connection to register!

route manipulation in redistribution


Hi, Hope you can give me some feedback


I want to redistribute BGP to OSPF as the image shows


I have 2 links, the primary link is carrying only internet traffic, the secondary internet link is empty


I want to inject only BGP prefixes to the secondary internet link (Which is empty) to avoid saturation


How to can do that? from the redistribution command?

both sides? consideration? 

any help is much appreciated,




Does R5 and R6 have a BGP peer to each other or is it OSPF only? Is R4 your router or is it the ISP router?  Do you only have 1 router peering with your ISP?


yes, there is iBGP between R5 and R6 likewise R1 and R2, however there is a OSPF process running already, but the existing OSPF process is for internet traffic only between the sites,


Sorry for the diagram, yes, both R5 and R6 have a peering with R4 likewise R1 and R2 have ebgp peering with R3


there is also a OSPF process running between R1 and R2 as well as R5 and R6 for redundancy


I would like to know how to inject the bgp routes to the VC that is not being used, so it can use the alternate path via OSPF instead, but currently the primary for Internet is the best path installed in OSPF


essentially, I want to put the bgp traffic to the other leg being emtpy leaving the internet traffic alone in the other circuit,


please your help



Essentially you would want to use route-maps and Local Preference to split up your prefixes that you are receiving from your ISP.

For example, say you receive 4 prefixes from R3:


On R2, you would configure:

ip prefix-list prefer-R2 permit

ip prefix-list prefer-R2 permit


route-map PREFER-R2

match ip prefix-list prefer-R2

set local-preference 200

Then attach the route-map to the R3 neighbor


On R1, you would configure:

ip prefix-list prefer-R1 permit

ip prefix-list prefer-R1 permit


route-map PREFER-R1

match ip prefix-list prefer-R1

set local-preference 200

Then attach the route-map to the R3 neighbor


This is a very manual way to help bring some traffic onto other links

super thanks,

well actually, I have it like that, for eBGP prefixes received, I left R1 as primary and R2 as secondary with local preference, in fact, thats the way it is now,

however, what I want to achieve is that once prefixes coming from eBGP and are being redistributed to OSPF, once all internet traffic and BGP traffic are in OSPF, how can I just send the BGP traffic to use the secondary VC instead of using the primary where the internet traffic is passing?

sorry if I dont understand your full picture :( I just dont know how to inject the bgp into ospf only to use the secondary VC so each site can reach each other but only using the secondary VC and not using the primary

any ideas? or is it the same process you are describing?

let say that R3 goes down, so LANs from R1 and R2 should go via VC 722 instead of VC721 for the injected bgp prefixes

and in the VC721 would be passing internet traffic, not mixing up in other words,
this scenario is like for a failover purpose that in the case of R3 goes down, BGP traffic should pass via the other VC without not touching cost in the primary VC because thats the way it should be, like load balance the traffic

hope that it helps, but I really appreciate your time, please tell me any more ideas,

thanks so much

If it was me, I would move the connection that is between the edge routers to the opposing router instead , so R1 would connect to R5 and R6, and R2 would connect to R5 and R6.  


Then you would use OSPF ecmp to you can do full load balancing in OSPF.  Then it will also load balance across BGP.  You can then use BGP communities with you ISP if you want to influence any routes coming back from them to prefer R1 or R2.



super thanks! I wish I could do that, but thats not what I have,

I just want to know how to inject only coming bgp traffic to the other VC and leave the primary as it is (np BGP traffic)

thank you

You can't with the iBGP and Local Pref in place. The only thing possible is to use multi-path so that it redistributes both paths into OSPF. Or you can use a filter on incoming prefix advertisements on R2 and R6 so that only the prefixes learned on R2 and R6 get injected into OSPF

Thank you Sir,

yeah, I know its a bit weird the set up, as much as I tried to play with cost/metrics, I could not make it work,

and I was thinking about a distribute list but as Cisco says its not a best practice

I will deep dive a bit more

thank you so much