Injecting partial BGP/Aggregate routes into OSPF

Is this doable? Found no example. I don’t want to do iBGP everywhere. I just want to redistribute a handful routes into ospf as soon as they are learned with bgp. The rest should use default routes.

How many routes do you want to put in OSPF?

About 20 in addition to our internal routes (300).

On the BGP routers, turn on bgp redistribution then add only the wanted routes into ospf-out filter denying the others, so it will redistribute only those?

Done this? I fear as the BGP process is single threaded and eats a whole cpu of the CCR it may cause problems.

I do do this, albeit limited. My bigger network runs only BGP as it is a core routing setup, in another country we run more an OSPF mesh around about 7 sites linked together by fixed wireless at the moment.

In that country I have 2 BGP routers, one primary supplier one secondary supplier, so I BGP with them, and I then inject only the default route into OSPF from that BGP though, and I do also have a 3rd BGP router peering with an IX but all those routes are pushed into OSPF.

How many routes does the BGP router have? if you are taking full tables then yes changes can and may take some time to reflect in the FIB, but if you are not taking full table then it shouldnt hurt you all that much.

You have to get into hundreds of thousands of routes before this is a real issue. With a few hundred routes, it will be fine. Even a few thousand in BGP converges very quickly.

Trying this now but my routing filters do not work as expected.

I test with an ibgp peer where I only send all (global) /8 prefixes from a running bgp server to keep table small for testing.

I see the /8 prefixes coming in but the ospf filter does not match as expected. Nothing is redistributed into ospf.

/routing filter
add action=accept chain=ospf-out prefix=4.0.0.0/8 prefix-length=8 protocol=“”
add action=accept chain=ospf-out prefix=27.0.0.0/8 prefix-length=8
add action=discard chain=ospf-out protocol=bgp

I try to inject 4.0.0.0/8 and 27.0.0.0/8 into ospf but they dont appear. Removing the discard line I see all global /8 routes injected into ospf including 4.0.0.0 and 27.0.0.0. So the first 2 filter lines do not work ?