Community discussions

MikroTik App
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

BGP community filter

Sat Sep 03, 2016 11:05 am

Hello!

Again I'm in troubles:

/ip route print detail where dst-address=31.44.12.0/23
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
0 ADb dst-address=31.44.12.0/23 gateway=31.44.12.203
gateway-status=31.44.12.203 reachable via VL1.150 distance=200 scope=40 target-scope=30
bgp-local-pref=900 bgp-med=0 bgp-origin=igp bgp-communities=65070:101
received-from=lix-v4-bsd


/ip route print where bgp-communities=65070:101
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE


What's wrong???

And is there a way to test route filter before applying it to peer? As ciso:
route-map XXXX....
show ip bgp route-map XXXX
 
patrick7
Member
Member
Posts: 352
Joined: Sat Jul 20, 2013 2:40 pm

Re: BGP community filter

Mon Sep 05, 2016 5:22 pm

Try
/ip route print where bgp-communities="65070:101"
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Re: BGP community filter

Mon Sep 05, 2016 7:22 pm

No, the right version is
/ip route print where bgp-communities ~ "65070:101"

And this is wondering why so different syntax.

Regards,
Boris
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7193
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: BGP community filter

Tue Sep 06, 2016 11:31 am

Because communities is an array. And array cannot be equal with a string. So you should use ~ which translates as is bgp community contains xx:xx.
Or you could convert your string to an array
/ip route print where bgp-communities=[:toarray "65070:101"]
 
borisk
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 97
Joined: Mon Jul 04, 2016 10:02 pm
Location: Nizhniy Tagil, Russia

Re: BGP community filter

Tue Sep 06, 2016 6:06 pm

thank you for clarification!

Who is online

Users browsing this forum: Dude2048 and 11 guests