BGP set-bgp-local-pref question

Hello!
I have RB1000 with 2 uplink and BGP routing.
Trying to manage incoming routing between 2 uplinks with setting BGP local preference to routes.
But local preference doesn’t set :frowning:

Config (194.8.128.0/22 is my network, default incoming route is killed):

/routing bgp network
add comment=“” disabled=no network=194.8.128.0/22 synchronize=no

/routing bgp instance
set default as=49107 client-to-client-reflection=no comment=“” disabled=no ignore-as-path-len=no name=default out-filter=“” redistribute-connected=no redistribute-ospf=no
redistribute-other-bgp=no redistribute-rip=no redistribute-static=no router-id=194.8.128.254

/routing bgp peer
add address-families=ip comment=“” default-originate=never disabled=no hold-time=3m in-filter=stavcom-in instance=default multihop=no name=stavcom nexthop-choice=default
out-filter=stavcom-out remote-address=85.159.32.85 remote-as=34676 remove-private-as=no route-reflect=no tcp-md5-key=“” ttl=default
add address-families=ip comment=“” default-originate=never disabled=no hold-time=3m in-filter=synterra-in instance=default multihop=no name=synterra nexthop-choice=default
out-filter=synterra-out remote-address=95.129.92.41 remote-as=47218 remove-private-as=yes route-reflect=no tcp-md5-key=“” ttl=default

/routing filter
add action=discard chain=synterra-in comment=“” disabled=no invert-match=no prefix=0.0.0.0 prefix-length=0
add action=accept chain=synterra-in comment=“” disabled=no invert-match=no prefix=0.0.0.0 prefix-length=1-32 set-bgp-local-pref=200 set-bgp-weight=5
add action=accept chain=synterra-out comment=“” disabled=no invert-match=no prefix=194.8.128.0/22 prefix-length=22-32
add action=discard chain=synterra-out comment=“” disabled=no invert-match=no prefix=0.0.0.0/0 prefix-length=0-32
add action=discard chain=stavcom-in comment=“” disabled=no invert-match=no prefix=0.0.0.0 prefix-length=0
add action=discard chain=stavcom-out comment=“” disabled=no invert-match=yes prefix=194.8.128.0/22 prefix-length=22-32

So, selected string is non-working, preference is not set.
Why?

change that red line to ‘prefix=0.0.0.0**/0**’ or deselect the prefix all togehter in winbox.

Thank you very much!
Now it works! :slight_smile:

Anyway, what was wrong?

According to http://wiki.mikrotik.com/wiki/BGP_HowTo_%26_FAQ all is right:

Most likely prefix matcher is configured incorrectly. For example, say that you want to configure filter that will discard all routes falling under prefix 1.1.1.0/24. 

The correct way to do this is with specifying prefix-length matcher: 

add prefix=1.1.1.0/24 prefix-length=24-32 action=discard chain=bgp-in
Or (the same effect): 

add prefix=1.1.1.0 prefix-length=24-32 action=discard chain=bgp-in

Why does 0.0.0.0 without /0 not work?

without a cidr mask it is probably /32.