Configuring Enhanced Object Tracking

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.

Information About Enhanced Object Tracking

Enhanced Object Tracking Overview

Before the introduction of the Enhanced Object Tracking feature, Hot Standby Router Protocol (HSRP) had a simple tracking mechanism that allowed you to track the interface line-protocol state only. If the line-protocol state of the interface went down, the HSRP priority of the router was reduced, allowing another HSRP router with a higher priority to become active.

The Enhanced Object Tracking feature separates the tracking mechanism from HSRP and creates a separate standalone tracking process that can be used by processes other than HSRP. This feature allows the tracking of other objects in addition to the interface line-protocol state.

A client process such as HSRP, Virtual Router Redundancy Protocol (VRRP), or Gateway Load Balancing Protocol (GLBP), can register its interest in tracking objects and then be notified when the tracked object changes state.

Note
Note

Enhanced Object Tracking is not supported on switches running the LAN Base image.


Each tracked object has a unique number that is specified in the tracking command-line interface (CLI). Client processes use this number to track a specific object. The tracking process periodically polls the tracked object for value changes and sends any changes (as up or down values) to interested client processes, either immediately or after a specified delay. Several clients can track the same object, and can take different actions when the object changes state.

You can also track a combination of objects in a list by using either a weight threshold or a percentage threshold to measure the state of the list. You can combine objects using Boolean logic. A tracked list with a Boolean “AND” function requires that each object in the list be in an up state for the tracked object to be up. A tracked list with a Boolean “OR” function needs only one object in the list to be in the up state for the tracked object to be up.

Tracking Interface Line-Protocol or IP Routing State

You can track either the interface line protocol state or the interface IP routing state. When you track the IP routing state, these three conditions are required for the object to be up:
  • IP routing must be enabled and active on the interface.

  • The interface line-protocol state must be up.

  • The interface IP address must be known.

If all three of these conditions are not met, the IP routing state is down.

Tracked Lists

You can configure a tracked list of objects with a Boolean expression, a weight threshold, or a percentage threshold. A tracked list contains one or more objects. An object must exist before it can be added to the tracked list.

  • You configure a Boolean expression to specify calculation by using either “AND” or “OR” operators.

  • When you measure the tracked list state by a weight threshold, you assign a weight number to each object in the tracked list. The state of the tracked list is determined by whether or not the threshold was met. The state of each object is determined by comparing the total weight of all objects against a threshold weight for each object.

  • When you measure the tracked list by a percentage threshold, you assign a percentage threshold to all objects in the tracked list. The state of each object is determined by comparing the assigned percentages of each object to the list.

Tracking Other Characteristics

You can also use the enhanced object tracking for tracking other characteristics.

  • You can track the reachability of an IP route by using the track ip route reachability global configuration command.

  • You can use the track ip route metric threshold global configuration command to determine if a route is above or below threshold.

  • You can use the track resolution global configuration command to change the metric resolution default values for routing protocols.

  • You can use the track timer tracking configuration command to configure the tracking process to periodically poll tracked objects.

Use the show track privileged EXEC command to verify enhanced object tracking configuration.

IP SLAs Object Tracking

Cisco IOS IP Service Level Agreements (IP SLAs) is a network performance measurement and diagnostics tool that uses active monitoring by generating traffic to measure network performance. Cisco IP SLAs operations collects real-time metrics that you can use for network troubleshooting, design, and analysis.

Object tracking of IP SLAs operations allows clients to track the output from IP SLAs objects and use this information to trigger an action. Every IP SLAs operation maintains an SNMP operation return-code value, such as OK or OverThreshold, that can be interpreted by the tracking process. You can track two aspects of IP SLAs operation: state and reachability. For state, if the return code is OK, the track state is up; if the return code is not OK, the track state is down. For reachability, if the return code is OK or OverThreshold, reachability is up; if not OK, reachability is down.

Static Route Object Tracking

Static routing support using enhanced object tracking provides the ability for the switch to use ICMP pings to identify when a pre-configured static route or a DHCP route goes down. When tracking is enabled, the system tracks the state of the route and informs the client when that state changes. Static route object tracking uses Cisco IP SLAs to generate ICMP pings to monitor the state of the connection to the primary gateway.

This feature is supported only on the IP Services image

How to Configure Enhanced Object Tracking

Configuring Tracking for Line State Protocol or IP Routing State on an Interface

Follow these steps to track the line-protocol state or IP routing state of an interface:

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. track object-numberinterface interface-idline-protocol
  4. delay { object-numberup seconds[down seconds]|[up seconds]down seconds}
  5. exit
  6. track object-numberinterface interface-idip routing
  7. delay { object-numberup seconds[down seconds]|[up seconds]down seconds}
  8. end
  9. show track object-number

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

track object-numberinterface interface-idline-protocol

Example:

Switch(config)# track 33 interface gigabitethernet 1/0/1 line-protocol

(Optional) Creates a tracking list to track the line-protocol state of an interface and enter tracking configuration mode.

  • The object-number identifies the tracked object and can be from 1 to 500.

  • Theinterface interface-id is the interface being tracked.

Step 4

delay { object-numberup seconds[down seconds]|[up seconds]down seconds}

(Optional) Specifies a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds.

Step 5

exit

Returns to global configuration mode.

Step 6

track object-numberinterface interface-idip routing

Example:

Switch(config)# track 33 interface gigabitethernet 1/0/1 ip routing

(Optional) Creates a tracking list to track the IP routing state of an interface and enter tracking configuration mode. IP route tracking tracks an IP route in the routing table and the ability of an interface to route IP packets.

  • The object-number identifies the tracked object and can be from 1 to 500.

  • Theinterface interface-id is the interface being tracked.

Step 7

delay { object-numberup seconds[down seconds]|[up seconds]down seconds}

(Optional) Specifies a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds.

Step 8

end

Returns to privileged EXEC mode.

Step 9

show track object-number

Verifies that the specified objects are being tracked.

Configuring Tracked Lists

Configuring a Tracked List with a Weight Threshold

To track by weight threshold, configure a tracked list of objects, specify that weight is used as the threshold, and configure a weight for each of its objects. The state of each object is determined by comparing the total weight of all objects that are up against a threshold weight for each object.

You cannot use the Boolean “NOT” operator in a weight threshold list.

Follow these steps to configure a tracked list of objects by using a weight threshold and to configure a weight for each object:

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. track track-numberlist threshold {weight }
  4. object object-number[weight weight-number]
  5. threshold weight {up number|[down number]}
  6. delay { up seconds[down seconds]|[up seconds]down seconds}
  7. end
  8. show track object-number
  9. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

track track-numberlist threshold {weight }

Example:

Switch(config)# track 4 list threshold weight

Configures a tracked list object, and enters tracking configuration mode. The track-number can be from 1 to 500.

  • threshold— Specifies the state of the tracked list based on a threshold.

  • weight— Specifies that the threshold is based on weight.

Step 4

object object-number[weight weight-number]

Example:

Switch(config)# object 2 weight 15
Specifies the object to be tracked. The range is from 1 to 500. The optionalweight weight-number specifies the threshold weight for the object. The range is from 1 to 255.
Note 

An object must exist before you can add it to a tracked list.

Step 5

threshold weight {up number|[down number]}

Example:

Switch(config-track)# threshold weight up 30 down 10
(Optional) Specifies the threshold weight.
  • up number— The range is from 1 to 255.

  • down number— (Optional)The range depends on the number selected for the up number . If you configure the up number as 25, the range shown for the down number is 0 to 24.

Step 6

delay { up seconds[down seconds]|[up seconds]down seconds}

(Optional) Specifies a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds.

Step 7

end

Returns to privileged EXEC mode.

Step 8

show track object-number

Verify that the specified objects are being tracked.

Step 9

copy running-config startup-config

Example:


Switch# copy running-config startup-config 

(Optional) Saves your entries in the configuration file.

Configuring a Tracked List with a Percentage Threshold

To track by percentage threshold, configure a tracked list of objects, specify that a percentage will be used as the threshold, and specify a percentage for all objects in the list. The state of the list is determined by comparing the assigned percentage of each object to the list.

You cannot use the Boolean “NOT” operator in a percentage threshold list.

Follow these steps to configure a tracked list of objects by using a percentage threshold:

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. track track-numberlist threshold {percentage }
  4. object object-number
  5. threshold percentage {up number|[down number]}
  6. delay { up seconds[down seconds]|[up seconds]down seconds}
  7. end
  8. show track object-number
  9. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

track track-numberlist threshold {percentage }

Example:

Switch(config)# track 4 list threshold percentage

Configures a tracked list object, and enters tracking configuration mode. The track-number can be from 1 to 500.

  • threshold— Specifies the state of the tracked list based on a threshold.

  • percentage— Specifies that the threshold is based on percentage.

Step 4

object object-number

Example:

Switch(config)# object 1
Specifies the object to be tracked. The range is from 1 to 500.
Note 

An object must exist before you can add it to a tracked list.

Step 5

threshold percentage {up number|[down number]}

Example:

Switch(config)# threshold percentage up 51 down 10
(Optional) Specifies the threshold percentage.
  • up number— The range is from 1 to 100.

  • down number— (Optional)The range depends on the number selected for the up number . If you configure the up number as 25, the range shown for the down number is 0 to 24.

Step 6

delay { up seconds[down seconds]|[up seconds]down seconds}

(Optional) Specifies a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds.

Step 7

end

Returns to privileged EXEC mode.

Step 8

show track object-number

Verify that the specified objects are being tracked.

Step 9

copy running-config startup-config

Example:


Switch# copy running-config startup-config 

(Optional) Saves your entries in the configuration file.

Configuring HSRP Object Tracking

Follow these steps to configure a standby HSRP group to track an object and change the HSRP priority based on the object state:

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. track object-number{interface interface-id{line-protocol |ip routing }|ip route ip address/prefix-length{metric threshold |reachability }list {boolean {and |or }}|{threshold {weight |percentage }}}
  4. exit
  5. interface { interface-id
  6. standby [group-number]ip [ip-addresssecondary ]]
  7. standby [group-number]track [object-number[decrement priority-decrement]]
  8. end
  9. show standby
  10. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

track object-number{interface interface-id{line-protocol |ip routing }|ip route ip address/prefix-length{metric threshold |reachability }list {boolean {and |or }}|{threshold {weight |percentage }}}

(Optional) Create a tracking list to track the configured state and enter tracking configuration mode.

  • The object-number identifies the tracked object and can be from 1 to 500.

  • Enterinterface interface-id to select an interface to track.

  • Enterline-protocol to track the interface line protocol state or enter ip routing to track the interface IP routing state .

  • Enterip route ip-address/prefix-length to track the state of an IP route.

  • Entermetric threshold to track the threshold metric or enter reachability to track if the route is reachable.

    The default up threshold is 254 and the default down threshold is 255.

  • Enter list to track objects grouped in a list.
    Note 

    Repeat this step for each interface to be tracked.

Step 4

exit

Return to global configuration mode.

Step 5

interface { interface-id

Enter interface configuration mode.

Step 6

standby [group-number]ip [ip-addresssecondary ]]

Creates (or enables) the HSRP group by using its number and virtual IP address.

  • (Optional) group-number —Enters a group number on the interface for which HSRP is being enabled. The range is 0 to 255; the default is 0. If there is only one HSRP group, you do not need to enter a group number.

  • (Optional on all but one interface) ip-address —Specifies the virtual IP address of the hot standby router interface. You must enter the virtual IP address for at least one of the interfaces; it can be learned on the other interfaces.

  • (Optional) secondary —Specifies that the IP address is a secondary hot standby router interface. If this keyword is omitted, the configured address is the primary IP address.

Step 7

standby [group-number]track [object-number[decrement priority-decrement]]

Configures HSRP to track an object and change the hot standby priority based on the state of the object.

  • (Optional) group-number —Enters the group number to which the tracking applies.

  • object-number —Enters a number representing the object to be tracked. The range is from 1 to 500; the default is 1.

  • (Optional) secondary —Specifies that the IP address is a secondary hot standby router interface. If this keyword is omitted, the configured address is the primary IP address.

  • (Optional)decrement priority-decrement —Specifies the amount by which the hot standby priority for the router is decremented (or incremented) when the tracked object goes down (or comes back up). The range is from 1 to 255; the default is 10.

Step 8

end

Returns to privileged EXEC mode.

Step 9

show standby

Verifies the standby router IP address and tracking states.

Step 10

copy running-config startup-config

Example:


Switch# copy running-config startup-config 

(Optional) Saves your entries in the configuration file.

Configuring IP SLAs Object Tracking

Follow these steps to track the state of an IP SLAs operation or the reachability of an IP SLAs IP host:

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. track object-numberrtr operation-numberstate
  4. delay { up seconds[down seconds]|[up seconds]down seconds}
  5. exit
  6. track object-numberrtr operation-numberstate
  7. end
  8. show track object-number
  9. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

track object-numberrtr operation-numberstate

Example:

Switch(config)# track 2 200 state

Enters tracking configuration mode to track the state of an IP SLAs operation.

  • object-number range is from 1 to 500.

  • operation-number range is from 1 to 2147483647.

Step 4

delay { up seconds[down seconds]|[up seconds]down seconds}

(Optional) Specifies a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds.

Step 5

exit

Returns to global configuration mode.

Step 6

track object-numberrtr operation-numberstate

Enters tracking configuration mode to track the state of an IP SLAs operation.

  • object-number range is from 1 to 500.

  • operation-number range is from 1 to 2147483647.

Step 7

end

Returns to privileged EXEC mode.

Step 8

show track object-number

Verifies that the specified objects are being tracked.

Step 9

copy running-config startup-config

Example:


Switch# copy running-config startup-config 

(Optional) Saves your entries in the configuration file.

Configuring Static Route Object Tracking

Configuring a Primary Interface for Static Routing

Follow these steps to configure a primary interface for static routing:

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. interface interface-id
  4. description string
  5. ip address ip-address mask[secondary ]
  6. exit

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

interface interface-id

Selects a primary or secondary interface and enters interface configuration mode.

Step 4

description string

Adds a description to the interface.

Step 5

ip address ip-address mask[secondary ]

Sets the primary or secondary IP address for the interface.

Step 6

exit

Returns to global configuration mode.

Configuring a Primary Interface for DHCP

Follow these steps to configure a primary interface for DHCP:

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. interface interface-id
  4. description string
  5. ip dhcp client route track number
  6. exit

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

interface interface-id

Selects a primary or secondary interface and enters interface configuration mode.

Step 4

description string

Adds a description to the interface.

Step 5

ip dhcp client route track number

Configures the DCHP client to associate any added routes with the specified track number. Valid numbers are from 1 to 500.

Step 6

exit

Returns to global configuration mode.

Configuring IP SLAs Monitoring Agent

You can configure an IP SLAs agent to ping an IP address using a primary interface and a track object to monitor the state of the agent.

Follow these steps to configure network monitoring with Cisco IP SLAs:

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. ip sla operation number
  4. icmp-echo { destination ip-address|destination hostname[source - ipaddr {ip-address|hostnamesource-interface interface-id]
  5. timeout milliseconds
  6. frequency seconds
  7. threshold milliseconds
  8. exit
  9. ip sla schedule operation-number[life {forever |seconds}]start-time time|pending |now |after time]ageout seconds][recurring ]
  10. track object-numberrtr operation-numberstate reachability
  11. end
  12. show track object-number
  13. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

ip sla operation number

Begins configuring a Cisco IP SLAs operation and enters IP SLA configuration mode.

Step 4

icmp-echo { destination ip-address|destination hostname[source - ipaddr {ip-address|hostnamesource-interface interface-id]

Configures a Cisco IP SLAs end-to-end ICMP echo response time operation and enter IP SLAs ICMP echo configuration mode.

Step 5

timeout milliseconds

Sets the amount of time for which the operation waits for a response from its request packet.

Step 6

frequency seconds

Sets the rate at which the operation is sent into the network.

Step 7

threshold milliseconds

Sets the rising threshold (hysteresis) that generates a reaction event and stores history information for the operation.

Step 8

exit

Exits IP SLAs ICMP echo configuration mode.

Step 9

ip sla schedule operation-number[life {forever |seconds}]start-time time|pending |now |after time]ageout seconds][recurring ]

Example:

Switch(config)# track 2 200 state

Configures the scheduling parameters for a single IP SLAs operation.

  • object-number range is from 1 to 500.

  • operation-number range is from 1 to 2147483647.

Step 10

track object-numberrtr operation-numberstate reachability

Tracks the state of a Cisco IOS IP SLAs operation and enter tracking configuration mode.

Step 11

end

Returns to privileged EXEC mode.

Step 12

show track object-number

Verifies that the specified objects are being tracked.

Step 13

copy running-config startup-config

Example:


Switch# copy running-config startup-config 

(Optional) Saves your entries in the configuration file.

Configuring a Routing Policy and a Default Route

Follow these steps to configure a routing policy for backup static routing by using object tracking.

SUMMARY STEPS

  1. enable
  2. configure terminal
  3. access-list access-list-number
  4. route-map map tag[permit |deny ][sequence-number]
  5. match ip address {access-list number[permit |deny ][sequence-number]
  6. set ip next-hop dynamic dhcp
  7. set interface interface-id
  8. exit
  9. ip local policy route-map map tag
  10. ip route prefix mask{ip address|interface-id[ip address]}[distance][name][permanent |track track-number][tag tag]
  11. end
  12. show ip route track table
  13. copy running-config startup-config

DETAILED STEPS

  Command or Action Purpose
Step 1

enable

Example:


Switch> enable

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:


Switch# configure terminal

Enters the global configuration mode.

Step 3

access-list access-list-number

Defines an extended IP access list. Configure any optional characteristics.

Step 4

route-map map tag[permit |deny ][sequence-number]

Enters route-map configuration mode and define conditions for redistributing routes from one routing protocol to another.

Step 5

match ip address {access-list number[permit |deny ][sequence-number]

Distribute any routes that have a destination network number address that is permitted by a standard or extended access list or performs policy routing on packets. You can enter multiple numbers or names.

Step 6

set ip next-hop dynamic dhcp

For DHCP networks only. Sets the next hop to the gateway that was most recently learned by the DHCP client.

Step 7

set interface interface-id

For static routing networks only. Indicates where to send output packets that pass a match clause of a route map for policy routing.

Step 8

exit

Returns to global configuration mode.

Step 9

ip local policy route-map map tag

Identifies a route map to use for local policy routing.

Step 10

ip route prefix mask{ip address|interface-id[ip address]}[distance][name][permanent |track track-number][tag tag]

For static routing networks only. Establishes static routes. Entering track track-number specifies that the static route is installed only if the configured track object is up.

Step 11

end

Returns to privileged EXEC mode.

Step 12

show ip route track table

Displays information about the IP route track table.

Step 13

copy running-config startup-config

Example:


Switch# copy running-config startup-config 

(Optional) Saves your entries in the configuration file.

Monitoring Enhanced Object Tracking

Use the privileged EXEC or user EXEC commands in the table below, to display enhanced object tracking information.

.

Table 1. Commands for Displaying Tracking Information

Command

Purpose

show ip route track table

Displays information about the IP route track table.

show track [object-number]

Displays information about the all tracking lists or the specified list.

show track brief

Displays VTP status and configuration for all interfaces or the specified interface.

show track interface [brief]

Displays information about tracked interface objects.

show track ip [object-number][brief ]route

Displays information about tracked IP-route objects

show track resolution

Displays the resolution of tracked parameters.

show track timer

Displays tracked polling interval timers.

Additional References

MIBs

MIB MIBs Link

All supported MIBs for this release.

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs

Technical Assistance

Description Link

The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies.

To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds.

Access to most tools on the Cisco Support website requires a Cisco.com user ID and password.

http://www.cisco.com/support