Hello Michael,
I have not been able to quickly identify an RFC that specifies the expected behaviour, but this is my understanding:
- The first consideration is the "prefix" length: compare the destination address masked with the "netmask" value for each route and select the route with the longest prefix match.
- If more than one route has the same length prefix match then select the one with the lowest metric.
In your initial message there might be a typo - you use the example address 100.1.2.3 - that only matches the default route.
If you meant 10.1.2.3, then that matches both routes but has a longer prefix match with route/netmask 10.0.0.0/255.0.0.0 (8 bits) than with 0.0.0.0/0.0.0.0 (0 bits) so interface 21 will be selected.
There is nothing that can sensibly described as "recursive" about this process - a single scan, matching first prefix length and then metric determines the route. If two or more interfaces are equivalent after this matching process then one of those interfaces will be chosen on an implementation dependent basis.
Gary