Community discussions

MikroTik App
 
doush
Long time Member
Long time Member
Topic Author
Posts: 644
Joined: Thu Jun 04, 2009 3:11 pm

BGP Advertise specific route only to a specific peer

Mon Jan 18, 2021 10:23 am

Hello;
I have 2 peers. Peer1 and Peer2
Adding a subnet into BGP> Networks automagically advertises the network to all peers.
I want only a specific prefix to be announced to a specific peer (peer1) and not advertise it to peer2
I couldn't figure out how to do it.
Any help is appreciated.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6195
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP Advertise specific route only to a specific peer

Mon Jan 18, 2021 10:28 am

You will need to set up routing filters for each peer.
 
doush
Long time Member
Long time Member
Topic Author
Posts: 644
Joined: Thu Jun 04, 2009 3:11 pm

Re: BGP Advertise specific route only to a specific peer

Mon Jan 18, 2021 10:41 am

Ok thanks.
So for that specific prefix in filters;
I will just make chain = peer2-out , prefix= x.x.x.x/24, action = accept ?
And chain = peer1-out, prefix = x.x.x.x/24, action = discard ?
 
joegoldman
Long time Member
Long time Member
Posts: 568
Joined: Mon May 27, 2013 2:05 am

Re: BGP Advertise specific route only to a specific peer

Tue Jan 19, 2021 8:13 am

Ok thanks.
So for that specific prefix in filters;
I will just make chain = peer2-out , prefix= x.x.x.x/24, action = accept ?
And chain = peer1-out, prefix = x.x.x.x/24, action = discard ?
Essentially yes - but if i remember correctly if there's no rule to 'reject' your other prefixes then they will still be advertised - so if you ONLY want to do that /24 to peer2, then best bet will be to:
chain=peer2-out prefix=x.x.x.x/24 action=accept
chain=peer2-out prefix=0.0.0.0/0 action=discard
So this means that it will advertise /24 but then any other prefix you have active will get discarded for that peer.
 
doush
Long time Member
Long time Member
Topic Author
Posts: 644
Joined: Thu Jun 04, 2009 3:11 pm

Re: BGP Advertise specific route only to a specific peer

Fri Jan 22, 2021 3:46 pm

As a side note, instance out filter (bgp-out) is not working as it should.
Normally it should be the global bgp-out filter, but it is not working at all when peers have different out filters set.
I hope it gets fixed or maybe I am doing something wrong.
Thanks a lot for the help.
 
joegoldman
Long time Member
Long time Member
Posts: 568
Joined: Mon May 27, 2013 2:05 am

Re: BGP Advertise specific route only to a specific peer

Wed Jan 27, 2021 10:52 pm

As a side note, instance out filter (bgp-out) is not working as it should.
Normally it should be the global bgp-out filter, but it is not working at all when peers have different out filters set.
I hope it gets fixed or maybe I am doing something wrong.
Thanks a lot for the help.
From the wiki:
Output routing filter chain used by all BGP peers belonging to this instance. Due to known problems in ROS v6, it is not recommended to use instance out-filter, instead use out-filter on peer.
Besides that - I believe that a peer filter will 'override' the instance filter anyway - they are not both processed - so only those peers without a filter defined would try and use instance filter - but either way best not to use it.

Who is online

Users browsing this forum: mikeeg02 and 14 guests