Community discussions

MikroTik App
 
faisali
Member Candidate
Member Candidate
Topic Author
Posts: 180
Joined: Fri Oct 08, 2010 5:11 am

Adding / Appeding bgp community to static or connected route

Sat Jul 02, 2011 9:52 pm

Hello,

Any suggestions on how to accomplish this if it is possible ? (translating from Cisco world).
ip prefix-list our-cidr permit 68.142.0.0/19 le 24

route-map static-bgp permit 10
match ip address prefix-list our-cidr
set origin igp
set community 11280:115

I know I can use the instance filter to append the community 11280:115 when sending the route to the peer.

The above in cisco world will actually add the bgp community to the local static routes as well, so that one was to query the local routing table for all routes included in the community 115 the local routes will also show up.

Many thanks in advance..

Faisal
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: Adding / Appeding bgp community to static or connected r

Sat Jul 02, 2011 9:56 pm

You could set a comment on the static route. Connected routes are dynamic and can't have any of their properties edited.
 
faisali
Member Candidate
Member Candidate
Topic Author
Posts: 180
Joined: Fri Oct 08, 2010 5:11 am

Re: Adding / Appeding bgp community to static or connected r

Sat Jul 02, 2011 10:15 pm

You could set a comment on the static route. Connected routes are dynamic and can't have any of their properties edited.
Well the idea behind the cisco config is that with the Static Routes also able to to have the bgp community attribute tagged to them, then one can do a simple one step filter for sending routes to another peer.

if this is not possible then it would be have to be a multiple lines to do the equivalent ..
i.e. one set of filters to send internal connected /static routes
and another set of filters to send other bgp learned routes which were tagged with community upon being received..


Thanks
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: Adding / Appeding bgp community to static or connected r

Sun Jul 03, 2011 11:02 pm

/routing filter
add chain=bgp-static-out action=accept prefix=68.142.0.0/19 prefix-length=19-24
add chain=bgp-local-out protocol=static match-chain=bgp-static-out set-bgp-communities=11280:115
add chain=bgp-out locally-originated-bgp=yes invert-match=no action=jump jump-target=bgp-local-out
add chain=bgp-out action=accept bgp-communities=11280:115
add chain=bgp-out action=discard

/routing bgp peer set some-peer out-filter=bgp-out
That should do what you want. I'll explain. The routing filter process goes like this:

1. Start in 'bgp-out.' If the routes are originated from 'self' then jump to chain 'bgp-local-out'
2. If a locally originated route is actually redistributed from static, and is present in the 'bgp-static-out' chain then set the BGP community 11280:115.
(bgp-local-out ends. We jump back to bgp-out)
3. Permit routes with community 11280:115.
4. Discard the rest.

Creating a separate bgp-static-out chain lets you utilize that chain like a prefix-list. You can have one rule in 'bgp-local-out' which then matches any routes contained in the chain / 'prefix-list' bgp-local-out.

I haven't tested this but it should work. Hope this helps.
 
faisali
Member Candidate
Member Candidate
Topic Author
Posts: 180
Joined: Fri Oct 08, 2010 5:11 am

Re: Adding / Appeding bgp community to static or connected r

Mon Jul 04, 2011 3:21 am

awesome... Thanks this helps me a great amount to understand how the filters work as well.

is there a good resource that you would recommend reading so as to be able to get a better understanding on all the different CLI options possible when writing the filters ?


Many Thanks :)
 
blake
Member
Member
Posts: 426
Joined: Mon May 31, 2010 10:46 pm
Location: Arizona

Re: Adding / Appeding bgp community to static or connected r

Mon Jul 04, 2011 3:43 am

Who is online

Users browsing this forum: No registered users and 23 guests