BGP learned routes (recursive via) following default

Hello All,

I am on version 6.10 (I know not the latest) and have a weirdness with routes learned via BGP that are to be recursive. multi-hop is enabled in the environment and peering is strictly based on Loopback addresses. The issue being seen is:

A route is learned with a next-hop/gateway being correct but within the /ip route nexthop, it is saying the forwarding address is to follow the default instead of the forwarding address of a more specific route route that points to the nexthop.

For notes in the example, 192.168.0.1 is the route to 0.0.0.0/0
192.168.67.0/32 is the specific route that is not correct and is pointing to the wrong nexthop
10.129.224.154 is what the forwarding next hop should be.
finally, the specific 192.168.6.61/32 is not in the routing table (because of filtering) but the larger 192.168.6.0/24 is and points Deeper into the network.



The following is then subsections with IP Addresses adjusted to protect the innocent:
[admin@RouterWithWrongForwardingNextHop] > /ip route nexthop print
0 address=192.168.6.61 gw-state=recursive forwarding-nexthop=192.168.0.1
interface=“” scope=30 check-gateway=none

[admin@RouterWithWrongForwardingNextHop] > /ip route print detail where dst-address=0.0.0.0/0
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 ADo dst-address=0.0.0.0/0 gateway=192.168.0.1
gateway-status=192.168.0.1 reachable via interfaceToWWW distance=110
scope=20 target-scope=10 route-tag=40 ospf-metric=10
ospf-type=external-type-2

[admin@RouterWithWrongForwardingNextHop] > /ip route print detail where dst-address=192.168.67.0/32
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
5 ADb dst-address=192.168.67.0/32 gateway=192.168.6.61
gateway-status=192.168.6.61 recursive via 192.168.0.1 interfaceToWWW
distance=20 scope=40 target-scope=30 bgp-as-path=“(64541)”
bgp-local-pref=100 bgp-origin=igp received-from=iBGPPeer

[admin@RouterWithWrongForwardingNextHop] > /ip route print detail where dst-address=198.18.6.0/24
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
6 ADb dst-address=198.18.6.0/24 gateway=10.129.224.154
gateway-status=10.129.224.154 reachable via interfaceDeeperInNetwork distance=20
scope=40 target-scope=30 bgp-as-path=“(64541)” bgp-local-pref=100
bgp-origin=igp received-from=iBGPPeer


My question is if this is an issue with BGP or an issue with nexthops. Additionally, how can I resolve this issue found with floating routes. Finally, should I be looking at my configuration or at Mikrotik support for an updated firmware/fix.

Thank you,
Gabe Selig

Please read how to use scopes and target scopes and how recursive routes are resolved
http://wiki.mikrotik.com/wiki/Manual:Using_scope_and_target-scope_attributes

Hello,

Using that information and information provided here: http://wiki.mikrotik.com/wiki/Manual:IP/Route, I managed to correct the issue presented. I had to do with scope/target-scope. I never knew what they were used for and still not have a full understanding yet. I did notice the rule where if the scope is greater than the target-scope, the route would not be be used for nexthop lookup. By lowering the BGP route on the inbound filter for the specific subnet that should be used as the next-hop to something lower than 40 (the default for BGP), the floating route followed the desired path.

Thank you very much.
Gabe Selig