While doing some studying today I came up with scenarios of tracking route metrics in order to manipulate routing. All went well until it came to tracking static route "metric". The only metric I am aware of for static routes is distance. Check out the router config below to make more sense of what follows.
The idea was to use two static routes to the same subnet but with different next hop and distance values. Both of them would be tracking separate SLA objects. The route with the lower distance would win as long as its SLA was good. If the SLA fails, the backup static is used with a significantly higher distance.
Easy peasy so far.
Next, I add two more static routes to another subnet with different next hops. One static has a low distance and tracks changes in the "metric" of the two previously configured static routes. The backup static does no tracking and has a much higher distance.
The way it should work is that a given static route will only be used if the metric of a separate static is under a configured threshold.
The first two static routes work as expected: I bring down a loopback on another router, the SLA fails, the object goes down, the lower distance route is removed and is replaced with the higher distance static. The distance of the backup static route is configured to be above the threshold of the tracked object in use for the second set of statics. This event should take that object down if distance is being considered the metric of static routes. Unfortunately, the object does not go down so the backup of the second pair of static routes is never used. The only way I can get the object to go down is by taking action to remove the tracked static route from the routing table. This makes sense if metric is still metric as we all know it, rather than metric being distance. Static route metric stays 0 regardless of what the distance is. If this is true, why does EOT allow tracking metrics of static routes in the first place? Thanks in advance for anyone that can shed some light on this.
Related configs below:
R1:
track resolution ip route static 1
!
track 3 ip route 8.8.8.8 255.255.255.255 metric threshold
threshold metric up 20 down 21
!
ip route 8.8.8.8 255.255.255.255 131.46.0.2 15 track 1
ip route 8.8.8.8 255.255.255.255 153.20.0.2 25 track 2
ip route 1.1.1.1 255.255.255.255 131.46.0.2 15 track 3
ip route 1.1.1.1 255.255.255.255 153.20.0.2 25