Enhanced Object Tracking or EOT can be very useful to meet specific task requirements you just can’t otherwise or at least not without a great deal of effort. This post briefly looks at a practical example on how to advertise a route, but only if specific requirements are met using EOT.
Consider a scenario where you would like to advertise a default route via IGP, RIP in this case, however only if two of your router’s interfaces are not down, i.e. line protocol Up. In other words, your router should only advertise a default RIP route when for instance FastEthernet 0/0 and FastEthernet 0/1 are down at the same time and NOT otherwise.
Without worrying about the topology he’s one way to do it.
! ! router ! conf t ! track 1 list boolean and object 10 not object 20 not ! track 10 interface FastEthernet0/0 line-protocol track 20 interface FastEthernet0/1 line-protocol ! ip route 0.0.0.0 0.0.0.0 Null0 track 1 ! router rip network 0.0.0.0 ! end
The logic is actually straight forward if you approach it as TRUE or FALSE statements which is essentially what they are. I’ll try to break it down and keep it simple so I don’t get myself confused as I tend to do when dealing with Boolean logic!
track 10 interface FastEthernet0/0 line-protocol track 20 interface FastEthernet0/1 line-protocol
Object track 10 as well as 20 will only evaluate to TRUE if the objects FastEthernet0/0 and FastEthernet0/1 line protocol are Up.
track 1 list boolean and object 10 not object 20 not
The not keyword at the end essentially reverts the logic of the object track 10 and 20- since we’re only looking to advertise a default route if both interfaces are down, object track 1 will only evaluate to TRUE if both object track 10 and object track 20 are NOT TRUE–line protocol down.
ip route 0.0.0.0 0.0.0.0 Null0 track 1
And finally, a static default route is only added to the RIB if object track 1 is TRUE.