Hello,
I came across a strange issue on Mikrotik Cloud Core routers CCR1036. Setup is quite simple, I use 2 routers on one location and 2 on the second, there are iBGP sessions between routers on same location, and eBGP sessions between 2 pairs of routers on remote locations. In that setup one router should preferably reach a network on remote location via eBGP, and in case of failure via iBGP and then the other link.
What actually happens is that router receives prefix via iBGP with default local preference set to 100 and ROUTER THEN PREFERS iBGP route (distance 200 over distance 20).
I tested this with route filtering and chaning announced local preference to 0, and it worked - router now prefers smaller distance parameter.
Below is the output with example of two subnets, one being active with greater distance (10.116.21.0), and the other being active as it should be after my intervention (10.116.23.0/24)
69 ADb dst-address=10.116.21.0/24 gateway=10.116.3.146 gateway-status=10.116.3.146 reachable via ether8-iBGP distance=200 scope=40 target-scope=30 bgp-local-pref=100
bgp-origin=igp received-from=MT-ZGALT-CORE2
70 Db dst-address=10.116.21.0/24 gateway=172.30.2.1 gateway-status=172.30.2.1 recursive via 10.116.4.22 sfp1G-Metronet_dark_fiber_ZG1 distance=20 scope=40 target-scope=30
bgp-as-path=“65002” bgp-origin=incomplete received-from=MT-ZG-CORE1
77 ADb dst-address=10.116.23.0/24 gateway=172.30.2.1 gateway-status=172.30.2.1 recursive via 10.116.4.22 sfp1G-Metronet_dark_fiber_ZG1 distance=20 scope=40 target-scope=30
bgp-as-path=“65002” bgp-origin=igp received-from=MT-ZG-CORE1
78 Db dst-address=10.116.23.0/24 gateway=10.116.3.146 gateway-status=10.116.3.146 reachable via ether8-iBGP distance=200 scope=40 target-scope=30 bgp-local-pref=0 bgp-origin=ig>
received-from=MT-ZGALT-CORE2
Is this an issue with Mikrotiks implementation of BGP, or am I missing something?