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
/* Configure track4 to track line-protocol state of the HundredGigE0/0/0/35 interface and take action on loopback interface. */
Router(config)#track track4
Router(config-track)#type line-protocol state
Router(config-track-line-prot)#interface HundredGigE0/0/0/35
Router(config-track-line-prot)#exit
/* Specify action to take when track4 state changes. In this example, the action happens when the track state changes to up. */
Router(config-track)#action
Router(config-track-action)#track-up error-disable interface Loopback100 auto-recover
Router(config-track)#exit
Router(config)#end
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
The following example shows you how to configure the action command for the loopback interface.
track track4
type line-protocol state
interface HundredGigE0/0/0/35
!
action
track-up error-disable interface Loopback100 auto-recover
!
!
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
Track track4
Interface HundredGigE0/0/0/35 line-protocol
Line protocol is DOWN
2 changes, last change 06:28:06 UTC Tue Jun 27 2023
Delay up 0 secs(default), down 0 secs(default)
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)
Lo100 up up Loopback 1500 0
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
HundredGigE0/0/0/35 admin-down admin-down 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 state of track4 becomes
"up" when the HundredGigE0/0/0/35 interface comes up. The show error-disable command displays the following output when track3 state is down and track4 state is up.
Router#show error-disable
Interface Error-Disable reason Retry (s) Time disabled
------------------- ------------------------------ --------- ---------------
Loopback100 ot-track-state-change --- 08:44:07
FH0/0/0/0 ot-track-state-change --- 08:42:08
FH0/1/0/0 ot-track-state-change --- 08:42:01
When track3 state is down and track4 state is up, 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)
Lo100 err-disable admin-down Loopback 1500 0
FourHundredGigE0/0/0/0 err-disable admin-down ARPA 1514 100000000
FourHundredGigE0/0/0/1 err-disable admin-down ARPA 1514 100000000
FourHundredGigE0/1/0/0 err-disable admin-down ARPA 1514 100000000
FourHundredGigE0/1/0/1 up up ARPA 1514 100000000
HundredGigE0/0/0/35 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.
Similarly, when track4 state goes down, the error-disable status on the interface Loopback100 clears because of the auto-recover configuration for track4.
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)
Lo100 up up Loopback 1500 0
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
HundredGigE0/0/0/35 admin-down admin-down ARPA 1514 100000000