You can configure tracks with the action command to enable Enhanced Object Tracking. As a prerequisite, configure the track type that is to be tracked.
The following example shows how to configure the action command on a track based on the change in state of the track:
/* Configure track1 to track line-protocol state of the interface FourHundredGigE0/0/0/1 */
Router#configure
Router(config)#track track1
Router(config-track)#type line-protocol state
Router(config-track-line-prot)#interface FourHundredGigE0/0/0/1
Router(config-track-line-prot)#exit
Router(config-track)#exit
/* Configure track2 to track line-protocol state of the interface FourHundredGigE0/1/0/1 */
Router(config)#track track2
Router(config-track)#type line-protocol state
Router(config-track-line-prot)#interface FourHundredGigE0/1/0/1
Router(config-track-line-prot)#exit
Router(config-track)#exit
/* Configure track3 with boolean AND of track1 state and track2 state. Specify actions to take when track3 state changes. */
Router(config)#track track3
Router(config-track)#type list boolean and
Router(config-track-list-boolean)#object track1
Router(config-track-list-boolean)#object track2
Router(config-track-line-boolean)#exit
Router(config-track)#action
Router(config-track-action)#track-down error-disable interface FourHundredGigE0/0/0/0 auto-recover
Router(config-track-action)#track-down error-disable interface FourHundredGigE0/1/0/0
The following running configuration example shows you how to configure the action command for the scenario described in Figure 1.
track track1
type line-protocol state
interface FourHundredGigE0/0/0/1
!
!
track track2
type line-protocol state
interface FourHundredGigE0/1/0/1
!
!
track track3
type list boolean and
object track1
object track2
!
action
track-down error-disable interface FourHundredGigE0/0/0/0 auto-recover
track-down error-disable interface FourHundredGigE0/1/0/0
Verification
To view the state of the track, use the show track command. Initially, let us assume the line-protocol state of FourHundredGigE0/0/0/1 (track1 interface) and FourHundredGigE0/1/0/1
(track2 interface) are up and HundredGigE0/0/0/35 (track4 interface) is down.
Router#show track
Track track3
List boolean and is UP
7 changes, last change 16:04:28 IST Mon Jul 02 2018
object track2 UP
object track1 UP
Track track1
Interface FourHundredGigE0/0/0/1 line-protocol
Line protocol is UP
7 changes, last change 16:04:28 IST Mon Jul 02 2018
Track track2
Interface FourHundredGigE0/1/0/1 line-protocol
Line protocol is UP
7 changes, last change 16:02:41 IST Mon Jul 02 2018
To verify if the interface configured for tracking is error-disabled, use the show error-disable command. As none of the track states match the track-action state, there are no error-disabled interfaces.
Router#show error-disable
Interface Error-Disable reason Retry (s) Time disabled
------------------- ------------------------------ --------- ---------------
There are no interfaces error-disabled matching the given criteria
To view the status of all the interfaces of the tracked object, use the show interface brief command.
Router#show interface brief
Intf Name Intf State LineP State Encap Type MTU (byte) BW (Kbps)
FourHundredGigE0/0/0/0 up up ARPA 1514 100000000
FourHundredGigE0/0/0/1 up up ARPA 1514 100000000
FourHundredGigE0/1/0/0 up up ARPA 1514 100000000
FourHundredGigE0/1/0/1 up up ARPA 1514 100000000
When a track state changes, the corresponding track action happens and the status of the interfaces configured in the action
changes. The state of track3 becomes "down" when either track1 state or track2 state becomes "down". The following show error-disable command displays the corresponding output.
Router#show error-disable
Interface Error-Disable reason Retry (s) Time disabled
------------------- ------------------------------ --------- ---------------
FH0/0/0/0 ot-track-state-change --- 08:42:08
FH0/1/0/0 ot-track-state-change --- 08:42:01
When the state of track3 is "down", the show interface brief command displays the following output.
Router#show interface brief
Intf Name Intf State LineP State Encap Type MTU (byte) BW (Kbps)
FourHundredGigE0/0/0/0 admin-down admin-down ARPA 1514 100000000
FourHundredGigE0/0/0/1 admin-down admin-down ARPA 1514 100000000
FourHundredGigE0/1/0/0 admin-down admin-down ARPA 1514 100000000
FourHundredGigE0/1/0/1 up up ARPA 1514 100000000
When track3 state comes back up, the error-disable status on the interface FourHundredGigE0/0/0/0 clears. This is because
of the auto-recover configuration for FourHundredGigE0/0/0/0. However, interface FourHundredGigE0/1/0/0 remains in the error-disable status because
auto-recover isn't configured on this interface.
The change reflects in the output of the show interface brief command.
RP/0/0/CPU0:ios#show interface brief
Intf Name Intf State LineP State Encap Type MTU (byte) BW (Kbps)
FourHundredGigE0/0/0/0 up up ARPA 1514 100000000
FourHundredGigE0/0/0/1 up up ARPA 1514 100000000
FourHundredGigE0/1/0/0 err-disable admin-down ARPA 1514 100000000
FourHundredGigE0/1/0/1 up up ARPA 1514 100000000