Skip to main content
Matrix
Explorer
April 4, 2023
Solved

How to BGP Adv Control specific subnets to specific Peer

  • April 4, 2023
  • 3 replies
  • 5823 views

Hi all 

 

I have a hub location that got about 9 BGP peers and also I had a route map on each peer to control certain routes, but I got this new problem and still thinking of a workaround on how to do it.

 

I am trying to advertise some specific static routes to a specific BGP neighbor let's say BGP neighbor 3 I was thinking if I am going to use the network command then I need to modify the rest of 8 route maps to deny these routes, if I am going to redistribute static route I will do the same.

 

So is there any way to advertise specific routes to a specific BGP peer without modifying the whole other BGP peers route maps?

 

Thanks 

Best answer by Toshi_Esumi

If you have only a few routes to be advertised to the other peers, you probably want to compose a prefix-list for those routes and filter them in. You can use the same route-map for all other peers. But I'm assuming those are many and keep changing. Then you have to "deny" specific routes you don't want to advertise to the other peer. Again, you can use the same route-map to all those peers, so shouldn't be too bad.

 

Your problem is not about you want to advertise specific routes to Peer3, but more about NOT to advertise specif routes to the other peers. You need to adjust advertisement accordingly to address that.

 

Toshi

3 replies

funkylicious
SuperUser
SuperUser
April 4, 2023

One thing I've learned doing the hard way.

Prefix-lists control what networks you send/receive, route-maps allow you to manipulate/traffic engineering for inbound/outbound traffic to/from peers.

"jack of all trades, master of none"
Matrix
MatrixAuthor
Explorer
April 4, 2023

I already had prefix lists inside the route map to control & Manipulate routes but this one I am still thinking of a proper way to advertise without touching all the route maps and prefix lists.


funkylicious
SuperUser
SuperUser
April 4, 2023

You can create custom prefix-list and attach them outbound to the peer to control what you advertise. They don't need to be referenced in a route-map.

https://community.fortinet.com/t5/FortiGate/Technical-Tip-How-to-control-BGP-route-advertisement-with-prefix/ta-p/192930

"jack of all trades, master of none"
Matrix
MatrixAuthor
Explorer
April 4, 2023

The prefix list won't work by itself I have to advertise the subnet into BGP using the network command or redistribute, which will cause all the peers to advertise this subnet, I believe if I attach a prefix list on the BGP peer it will be preferable than the already attached route map.


Toshi_Esumi
SuperUser
SuperUser
April 4, 2023

If you have only a few routes to be advertised to the other peers, you probably want to compose a prefix-list for those routes and filter them in. You can use the same route-map for all other peers. But I'm assuming those are many and keep changing. Then you have to "deny" specific routes you don't want to advertise to the other peer. Again, you can use the same route-map to all those peers, so shouldn't be too bad.

 

Your problem is not about you want to advertise specific routes to Peer3, but more about NOT to advertise specif routes to the other peers. You need to adjust advertisement accordingly to address that.

 

Toshi

Matrix
MatrixAuthor
Explorer
April 4, 2023

Yeah I agree with you my problem is to deny these routes from being advertised to the other peers and just allow it to peer 3, the other prob is all the peers have different route maps and prefix lists and some of them are transit routes.

But yeah I guess i need to adjust the adv .

Thanks 

Toshi_Esumi
SuperUser
SuperUser
April 4, 2023

If those are not RFC1918 range routes but public ones you're walking on a tight rope and easy to fall off if not vigilant. I would just say "good luck".

 

Toshi