Community discussions

MikroTik App
 
acidsas
newbie
Topic Author
Posts: 41
Joined: Tue May 21, 2013 1:48 pm

How do I forward BGP routes to another mikrotik?

Mon Aug 24, 2015 4:13 pm

Please take a look at attached diagram.
I have a 3 mikrotiks connected by GRE tunnel over private circuits (host a, host b & host c). There is a BGP session between host a & host b and host a & host c. Host A got 3 external BGP peers. Two of them are full table bgp peers (peer 1 & peer 2) and peer 3 got about 8.000 routes. I need to forward routes of peer 3 to my host b & host c and set host a as a gateway for these routes. How do I set it up with mikrotiks?
You do not have the required permissions to view the files attached to this post.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7188
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: How do I forward BGP routes to another mikrotik?

Mon Aug 24, 2015 6:53 pm

iBGP or eBGP?

If eBGP you don't need to do anything specific. Best routes are advertised further to other eBGP peers.
 
acidsas
newbie
Topic Author
Posts: 41
Joined: Tue May 21, 2013 1:48 pm

Re: How do I forward BGP routes to another mikrotik?

Mon Aug 24, 2015 7:12 pm

eBGP
I don't need to forward routes received from peer 1 & peer 2, only routes received from peer 3.
I've tried to set a comment "123" on routes received from peer 3 with filters and set an outbound filter for host b to match only routes with comment 123 and accept them and discard everything else. Still no go. Prefix count on host b is 0.
 
User avatar
shaoranrch
Member Candidate
Member Candidate
Posts: 184
Joined: Thu Feb 13, 2014 8:03 pm

Re: How do I forward BGP routes to another mikrotik?

Mon Aug 24, 2015 10:56 pm

Why don't you use regular expressions, something like:

^AS_

Where AS is the AS number from the peer you're receiving the routes (and want to advertise), something like this should work:

Only send routes to HOST A/B that are learnt by PEER 1 (assumming PEER 1 AS is 65001):
/routing filter
add action=accept bgp-as-path=^65001_ chain=TO_HOSTS
add action=discard chain=TO_HOSTS
And then apply the chain "TO_HOSTS" as the outgoing filter for Host A and B. Hope it helps.
 
acidsas
newbie
Topic Author
Posts: 41
Joined: Tue May 21, 2013 1:48 pm

Re: How do I forward BGP routes to another mikrotik?

Tue Aug 25, 2015 1:05 pm

shaoranrch thnx for your solution but I did it another way :)

I've set Route Targets with filters on routes received from PEER 3 and matched these targets with filters for the hosts B & C.

Diagram was a really simple example. I've got an extensive bgp configuration with 3 instances and 12 BGP peers, some of them are full-view bgp.
 
User avatar
shaoranrch
Member Candidate
Member Candidate
Posts: 184
Joined: Thu Feb 13, 2014 8:03 pm

Re: How do I forward BGP routes to another mikrotik?

Tue Aug 25, 2015 6:56 pm

shaoranrch thnx for your solution but I did it another way :)

I've set Route Targets with filters on routes received from PEER 3 and matched these targets with filters for the hosts B & C.

Diagram was a really simple example. I've got an extensive bgp configuration with 3 instances and 12 BGP peers, some of them are full-view bgp.
I'd like to see how you did it, care to share the code?

Good thing you found a solution.
 
acidsas
newbie
Topic Author
Posts: 41
Joined: Tue May 21, 2013 1:48 pm

Re: How do I forward BGP routes to another mikrotik?

Wed Aug 26, 2015 12:43 am

shaoranrch thnx for your solution but I did it another way :)

I've set Route Targets with filters on routes received from PEER 3 and matched these targets with filters for the hosts B & C.

Diagram was a really simple example. I've got an extensive bgp configuration with 3 instances and 12 BGP peers, some of them are full-view bgp.
I'd like to see how you did it, care to share the code?

Good thing you found a solution.
I'll post only lines with route targets, not my entire route filters. These rules are applied to my current filters in correct order so everything is operating as expected.

Incoming rule for the PEER 3.
/routing filter add action=accept chain=BGP-from-PEER3-to-me-in set-bgp-communities="" set-route-targets=123:321
Outgoing rule for the HOST B
/routing filter add action=accept bgp-communities="" chain=BGP-from-me-to-hostb protocol=bgp route-targets=123:321

Who is online

Users browsing this forum: jaclaz and 25 guests