In BGP recursive scenario, the recursive route is taking an unexpected next-hop. Here is the routing table:
S* 0.0.0.0/0 [10/0] via 10.10.10.1, wan
B 172.16.5.0/24 [20/0] via 172.80.80.1, MPLS, 2d18h20m
B 192.168.250.0/24 [20/0] via 172.16.5.1 (recursive via 10.10.10.1), 1d1h10m
The next-hop of the recursive route should be the second route in the table which is another BGP route. However, it's taking the default route on top.
When adding a static route which is exactly the same as the second BGP route, next-hop is determined correctly:
S* 0.0.0.0/0 [10/0] via 10.10.10.1, wan
S 172.16.5.0/24 [20/0] via 172.80.80.1, MPLS
B 192.168.250.0/24 [20/0] via 172.16.5.1 (recursive via 172.80.80.1), 1d1h10m
Is this an expected behavior?