BGP less specific route

Hi,

i have a quick question, i am announcing 4 /24 subnets to peer A.

Now i want to announce the less specific route which is /22 to peer B for fallback. If peer A goes down, the less specific route is used. peer B is for fallback only.

Are there any additional steps which i need to do or just i need to announce the /22 to peer B?

In my bridge i have configurated the gateway ips like:
189.22.22.1/24
189.22.23.1/24
189.22.24.1/24

When i add a less specific route, should i add new gateways like
189.22.22.1/22
189.22.23.1/22

I know this is a really basic question. I have read somewhere that i should use a loopback interface for the less specific peer, but this makes no sense to me.

Thank you!

Nobody here who can help?

You can get the routes into your routetable using ‘blackhole’ routes, so add the /22 as static routes type=blackhole, then its there.

Then filters for Peer B specify ONLY the /22 routes allowed out, and they will advertise. If Peer A goes down, BGP will pick up the /22 routes for Peer B, but by the time it gets to your router, your connected / more specific routes will take precedence.

You should do it this way for ALL your BGP routes (blackhole routes with higher distance), as in cases you may want to split your /24’s into /25’s or smaller, your current way forces the 4 /24’s to be ‘assigned’ that way and have a connected route.

I’d also consider using /23’s via Peer A, /22 via Peer B, so if you ever join IX or anything like that you can put /24’s into them.