Configuring Enhanced Object Tracking Features
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.
BEFORE YOU BEGIN
An object must exist before it can be added to a tracked list.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
track object-number interface interface-id line-protocol |
(Optional) Create a tracking list to track the line-protocol state of an interface and enter tracking configuration mode.
- The object-number identifies the tracked object. The range is from 1 to 1000.
- The interface interface-id is the interface being tracked.
|
Step 3 |
delay { up seconds [ down seconds ] | [ up seconds ] down seconds } |
(Optional) Specify a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds. |
Step 4 |
exit |
Return to global configuration mode. |
Step 5 |
track object-number interface interface-id ip routing |
(Optional) Create 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. The range is from 1 to 1000.
- The interface interface-id is the interface being tracked.
|
Step 6 |
delay { up seconds [ down seconds ] | [ up seconds ] down seconds } |
(Optional) Specify 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 |
Return 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 |
(Optional) Save your entries in the configuration file. |
EXAMPLE
This example configures the tracking of an interface line-protocol state and verifies the configuration:
Switch(config)# track 33 interface gigabitethernet0/1 line-protocol
Switch(config-track)# end
Interface GigabitEthernet0/1 line-protocol
Line protocol is Down (hw down)
1 change, last change 00:18:28
Configuring a Tracked List
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.
Configuring a Tracked List with a Boolean Expression
Configuring a tracked list with a Boolean expression enables calculation by using either “AND” or “OR” operators. For example, when tracking two interfaces using the “AND” operator, up means that both interfaces are up, and down means that either interface is down.
BEFORE YOU BEGIN
An object must exist before it can be added to a tracked list.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
track track-number list boolean { and | or } |
Configure a tracked list object, and enter tracking configuration mode. The track-number can be from 1 to 1000.
- boolean —Specify the state of the tracked list based on a Boolean calculation.
- and —Specify that the list is up if all objects are up or down if one or more objects are down.
- or —Specify that the list is up if one object is up or down if all objects are down.
|
Step 3 |
object object-number [ not ] |
Specify the object to be tracked. The range is from 1 to 1000. The keyword not negates the state of the object, which means that when the object is up, the tracked list detects the object as down. |
Step 4 |
delay { up seconds [ down seconds ] | [ up seconds ] down seconds } |
(Optional) Specify 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 |
end |
Return to privileged EXEC mode. |
Step 6 |
show track object-number |
Verify that the specified objects are being tracked. |
Step 7 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
Use the no track track-number global configuration command to delete the tracked list.
EXAMPLE
This example configures track list 4 with a Boolean AND expression that contains two objects with one object state negated. If the list is up, the list detects that object 2 is down:
Switch(config)# track 4 list boolean and
Switch(config-track)# object 1
Switch(config-track)# object 2 not
Switch(config-track)# exit
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.
BEFORE YOU BEGIN
An object must exist before it can be added to a tracked list.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
track track-number list threshold weight |
Configure a tracked list object and enter tracking configuration mode. The track-number can be from 1 to 1000.
- threshold —Specify the state of the tracked list based on a threshold.
- weight —Specify that the threshold is based on weight.
|
Step 3 |
object object-number [ weight weight-number ] |
Specify the object to be tracked. The range is from 1 to 1000.
- weight weight-number —(Optional) Specify a threshold weight for the object. The range is from 1 to 255.
|
Step 4 |
threshold weight { up number | [ down number ]} |
Specify the threshold weight.
- up number —The valid 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 5 |
delay { up seconds [ down seconds ] | [ up seconds ] down seconds } |
(Optional) Specify a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds. |
Step 6 |
end |
Return to privileged EXEC mode. |
Step 7 |
show track object-number |
Verify that the specified objects are being tracked. |
Step 8 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
Use the no track track-number global configuration command to delete the tracked list.
EXAMPLE
This example configures track list 4 to track by weight threshold. If object 1 and object 2 are down, then track list 4 is up because object 3 satisfies the up threshold value of 30. But if object 3 is down, both objects 1 and 2 must be up in order to satisfy the threshold weight.
Switch(config)# track 4 list threshold weight
Switch(config-track)# object 1 weight 15
Switch(config-track)# object 2 weight 20
Switch(config-track)# object 3 weight 30
Switch(config-track)# threshold weight up 30 down 10
Switch(config-track)# exit
This configuration can be useful if object 1 and object 2 represent two small bandwidth connections and object 3 represents one large bandwidth connection. The configured down 10 value means that once the tracked object is up, it will not go down until the threshold value is equal to or lower than 10, which in this example means that all connections are down.
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.
BEFORE YOU BEGIN
An object must exist before it can be added to a tracked list.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
track track-number list threshold percentage |
Configure a tracked list object and enter tracking configuration mode. The track-number can be from 1 to 1000.
- threshold —Specify the state of the tracked list based on a threshold.
- percentage —Specify that the threshold is based on percentage.
|
Step 3 |
object object-number |
Specify the object to be tracked. The range is from 1 to 1000. Note An object must exist before you can add it to a tracked list. |
Step 4 |
threshold percentage { up number | [ down number ]} |
Specify the threshold percentage.
- up number —The valid 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 5 |
delay { up seconds [ down seconds ] | [ up seconds ] down seconds } |
(Optional) Specify a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds. |
Step 6 |
end |
Return to privileged EXEC mode. |
Step 7 |
show track object-number |
Verify that the specified objects are being tracked. |
Step 8 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
Use the no track track-number global configuration command to delete the tracked list.
EXAMPLE
This example configures tracked list 4 with three objects and specified percentages to measure the state of the list:
Switch(config)# track 4 list threshold percentage
Switch(config-track)# object 1
Switch(config-track)# object 2
Switch(config-track)# object 3
Switch(config-track)# threshold percentage up 51 down 10
Switch(config-track)# exit
Configuring HSRP Object Tracking
Follow this procedure to configure the Hot Standby Router Protocol (HSRP) to track an object and change the Hot Standby priority on the basis of the state of the object.
BEFORE YOU BEGIN
An object must exist before it can be added to a tracked list.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
track object-number { interface interface-id { line-protocol | i p 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 range is from 1 to 1000.
- Enter interface interface-id to select an interface to track.
- Enter line-protocol to track the interface line protocol state or enter ip routing to track the interface IP routing state.
- Enter ip route ip-address/prefix-length to track the state of an IP route.
- Enter metric 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. Configure the list as described on the previous pages.
– For boolean , see the “Configuring a Tracked List with a Boolean Expression” section – For threshold weight , see the “Configuring a Tracked List with a Weight Threshold” section – For threshold percentage , see the “Configuring a Tracked List with a Percentage Threshold” section Note Repeat this step for each interface to be tracked. |
Step 3 |
exit |
Return to global configuration mode. |
Step 4 |
interface interface-id |
Enter interface configuration mode. |
Step 5 |
standby [ group-number ] ip [ ip-address [ secondary ]] |
Create (or enable) the HSRP group by using its number and virtual IP address.
- (Optional) group-number —Enter 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 —Specify 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 —Specify 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 6 |
standby [ group-number ] track object-number [ decrement [ priority-decrement ]] |
Configure HSRP to track an object and change the hot standby priority based on the state of the object.
- (Optional) group-number —Enter the group number to which the tracking applies.
- object-number —Enter a number representing the object to be tracked. The range is from 1 to 1000; the default is 1.
- (Optional) decrement priority-decrement —Specify 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 7 |
end |
Return to privileged EXEC mode. |
Step 8 |
show standby |
Verify the standby router IP address and tracking states. |
Step 9 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
EXAMPLE
In the following example, the tracking process is configured to track the line-protocol state of GigabitEthernet interface 1/0/0. HSRP on GigabitEthernet interface 0/0/0 then registers with the tracking process to be informed of any changes to the line-protocol state of GigabitEthernet interface 1/0/0. If the line protocol on GigabitEthernet interface 1/0/0 goes down, the priority of the HSRP group is reduced by 10.
Router A:
Device(config)# track 100 interface GigabitEthernet1/0/0 line-protocol
Device(config)# interface GigabitEthernet0/0/0
Device(config-if)# ip address 10.1.0.21 255.255.0.0
Device(config-if)# standby 1 preempt
Device(config-if)# standby 1 ip 10.1.0.1
Device(config-if)# standby 1 priority 110
Device(config-if)# standby 1 track 100 decrement 10
Router B:
Device(config)# track 100 interface GigabitEthernet1/0/0 line-protocol
Device(config)# interface GigabitEthernet0/0/0
Device(config-if)# ip address 10.1.0.22 255.255.0.0
Device(config-if)# standby 1 preempt
Device(config-if)# standby 1 ip 10.1.0.1
Device(config-if)# standby 1 priority 105
Device(config-if)# standby 1 track 100 decrement 10
In the following example, the tracking process is configured to track the IP-routing capability of GigabitEthernet interface 1/0/0. HSRP on GigabitEthernet interface 0/0/0 then registers with the tracking process to be informed of any changes to the IP-routing state of GigabitEthernet interface 1/0/0. If the IP-routing state on GigabitEthernet interface 1/0/0 goes down, the priority of the HSRP group is reduced by 10.
If both serial interfaces are operational, Router A will be the HSRP active router because it has the higher priority. However, if IP on GigabitEthernet interface 1/0/0 in Router A fails, the HSRP group priority will be reduced and Router B will take over as the active router, thus maintaining a default virtual gateway service to hosts on the 10.1.0.0 subnet.
Router A:
Device(config)# track 100 interface GigabitEthernet1/0/0 ip routing
Device(config)# interface GigabitEthernet0/0/0
Device(config-if)# ip address 10.1.0.21 255.255.0.0
Device(config-if)# standby 1 preempt
Device(config-if)# standby 1 ip 10.1.0.1
Device(config-if)# standby 1 priority 110
Device(config-if)# standby 1 track 100 decrement 10
Router B:
Device(config)# track 100 interface GigabitEthernet1/0/0 ip routing
Device(config)# interface GigabitEthernet0/0/0
Device(config-if)# ip address 10.1.0.22 255.255.0.0
Device(config-if)# standby 1 preempt
Device(config-if)# standby 1 ip 10.1.0.1
Device(config-if)# standby 1 priority 105
Device(config-if)# standby 1 track 100 decrement 10
Configuring Other Tracking 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.
Configuring 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.
For more information about Cisco IP SLAs on the switch, see the “Configuring Cisco IOS IP SLAs Operations” chapter in the System Management Software Configuration Guide for Cisco IE 2000U and Connected Grid Switches . For IP SLAs command information see the Cisco IOS IP SLAs Command Reference .
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:
– If the return code is OK, the track state is up.
– If the return code is not OK, the track state is down.
– If the return code is OK or OverThreshold, reachability is up.
– If the return code is not OK, reachability is down.
NoteThertr command used in previous Cisco IOS releases to configure IP SLAs operations is replaced by the ip sla command.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
track object-number ip sla operation-number state |
Enter tracking configuration mode to track the state of an IP SLAs operation.
- The object-number range is from 1 to 1000.
- The operation-number range is from 1 to 2147483647.
|
Step 3 |
delay { up seconds [ down seconds ] | [ up seconds ] down seconds } |
(Optional) Specify a period of time in seconds to delay communicating state changes of a tracked object. The range is from 1 to 180 seconds. |
Step 4 |
exit |
Return to global configuration mode. |
Step 5 |
track object-number ip sla operation-number reachability |
Enter tracking configuration mode to track the reachability of an IP SLAs IP host.
- The object-number range is from 1 to 1000.
- The operation-number range is from 1 to 2147483647.
|
Step 6 |
delay { up seconds [ down seconds ] | [ up seconds ] down seconds } |
(Optional) Specify 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 |
Return to privileged EXEC mode. |
Step 8 |
show track object-number |
Display tracking information to verify the configuration. |
Step 9 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
EXAMPLE
The following example shows how to configure the tracking process to track the state of IP SLAs operation 2:
Switch(config)# track 1 ip sla 2 state
The following example shows how to configure the tracking process to track the reachability of IP SLAs operation 3:
Switch(config)# track 2 ip sla 3 reachability
Configuring Static Routing Support
Static routing support using enhanced object tracking provides the ability for the switch to use ICMP pings to identify when a preconfigured 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.
For more information about Cisco IP SLAs support on the switch, the “Configuring Configuring Cisco IOS IP SLAs Operations” chapter in the System Management Software Configuration Guide for Cisco IE 2000U and Connected Grid Switches .
You use this process to configure static route object tracking:
Step 1 Configure a primary interface for static routing or for DHCP.
Step 2 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.
Step 3 Configure a default static default route using a secondary interface. This route is used only if the primary route is removed.
Configuring a Primary Interface for Static Routing
Follow this procedure to configure a primary interface for static routing.
BEFORE YOU BEGIN
An interface can have one primary IP address and multiple secondary IP addresses. Packets generated by the Cisco IOS software always use the primary IP address. Therefore, all routers and access servers on a segment should share the same primary network number.
If any router on a network segment uses a secondary address, all other devices on that same segment must also use a secondary address from the same network or subnet. Inconsistent use of secondary addresses on a network segment can very quickly cause routing loops.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Select a primary or secondary interface and enter interface configuration mode. |
Step 3 |
description string |
Add a description to the interface. |
Step 4 |
ip address ip-address mask [ secondary] |
Set the primary or secondary IP address for the interface. |
Step 5 |
exit |
Return to global configuration mode. |
EXAMPLE
This example configures Ethernet 1 as a primary interface:
Switch(config)# interface Ethernet 1
Switch(config-if)# description primary
Switch(config-if)# ip address 172.16.16.1 255.255.240.0
Configuring a Primary Interface for DHCP
The following procedure configures a primary interface for DHCP.
BEFORE YOU BEGIN
The ip dhcp client command must be configured before the ip address dhcp command is configured on an interface. The ip dhcp client command is checked only when an IP address is acquired from DHCP. If the ip dhcp client command is specified after an IP address has been acquired from DHCP, the ip dhcp client command will not take effect until the next time the router acquires an IP address from DHCP.
DETAILED STEPS
|
|
|
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
interface interface-id |
Select a primary or secondary interface and enter interface configuration mode. |
Step 3 |
description string |
Add a description to the interface. |
Step 4 |
ip dhcp client route track number |
Configure the DCHP client to associate any added routes with the specified track number. Valid numbers are from 1 to 500. |
Step 5 |
ip address dhcp |
Acquire an IP address on an Ethernet interface from DHCP. |
Step 6 |
exit |
Return to global configuration mode. |
Step 7 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
EXAMPLE
The following example configures DHCP on an Ethernet interface and associates tracked object 123 with routes generated from this interface:
ip dhcp client route track 123
Configuring a Cisco IP SLAs Monitoring Agent and Track Object
BEFORE YOU BEGIN
After you schedule an operation, you cannot modify the configuration of the operation. To modify the configuration of the operation after it is scheduled, you must first delete the IP SLAs operation (using the no ip sla command) and then reconfigure the operation with the new operation parameters.
DETAILED STEPS
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
ip sla operation-number |
Begin configuring a Cisco IP SLAs operation and enter IP SLA configuration mode. |
Step 3 |
icmp-echo { destination-ip-address | destination hostname [ source- ipaddr { ip-address | hostname source-interface interface-id ] |
Configure a Cisco IP SLAs end-to-end ICMP echo response time operation and enter IP SLAs ICMP echo configuration mode. |
Step 4 |
timeout milliseconds |
Set the amount of time for which the operation waits for a response from its request packet. |
Step 5 |
frequency seconds |
Set the rate at which the operation is sent into the network. |
Step 6 |
threshold milliseconds |
Set the rising threshold (hysteresis) that generates a reaction event and stores history information for the operation. |
Step 7 |
exit |
Exit IP SLAs ICMP echo configuration mode. |
Step 8 |
ip sla schedule operation-number [ life { forever | seconds }] start-time time | pending | now | after time ] [ ageout seconds ] [ recurring ] |
Configure the scheduling parameters for a single IP SLAs operation. |
Step 9{ |
track object-number ip sla operation-number { state | reachability } |
Track the state of a Cisco IOS IP SLAs operation and enter tracking configuration mode. |
Step 10 |
end |
Return to privileged EXEC mode. |
Step 11 |
show track object-number |
Display tracking information to verify the configuration. |
Step 12 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
EXAMPLE
This example configures an IP SLAs operation for tracking:
Switch# configure terminal
Switch(config-ip-sla)# icmp-echo 172.29.139.134 source-ip 172.29.139.132
Switch(config-ip-sla-echo)# frequency 300
Switch(config-ip-sla-echo)# exit
Switch(config)# ip sla schedule 10 life forever start-time now
Switch(config)# track 2 ip sla 3 reachability
Switch(config)# end
Configuring a Routing Policy and Default Route
Follow these steps to configure a routing policy for backup static routing by using object tracking.
DETAILED STEPS
:
Step 1 |
configure terminal |
Enter global configuration mode. |
Step 2 |
access-list access-list-number |
Define an extended IP access list. Configure any optional characteristics. |
Step 3 |
route-map map-tag [ permit | deny ] [ sequence-number ] |
Enter route-map configuration mode and define conditions for redistributing routes from one routing protocol to another. |
Step 4 |
match ip address { access-list number | access-list name } |
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 5 |
set ip next-hop dynamic dhcp |
For DHCP networks only. Set the next hop to the gateway that was most recently learned by the DHCP client. |
Step 6 |
set interface interface-id |
For static routing networks only. Indicate where to send output packets that pass a match clause of a route map for policy routing. |
Step 7 |
exit |
Exit route-map configuration mode. |
Step 8 |
ip local policy route-map map-tag |
Identify a route map to use for local policy routing. |
Step 9{ |
ip route prefix mask { ip-address | interface-id [ ip-address ]} [ distance ] [ name ] [ permanent | track track-number ] [ tag tag ] |
For static routing networks only. Establish static routes. Entering track track-number specifies that the static route is installed only if the configured track object is up. |
Step 10 |
end |
Return to privileged EXEC mode. |
Step 11 |
show ip route track table |
Display information about the IP route track table. |
Step 12 |
copy running-config startup-config |
(Optional) Save your entries in the configuration file. |
EXAMPLE
The following example configures a routing policy for backup static routing by using object tracking:
ip address 209.165.202.129 255.255.255.255
ip address 209.165.200.225 255.255.255.255
type echo protocol ipIcmpEcho 172.16.23.7
ip sla monitor schedule 1 life forever start-time now
track 123 ip sla 1 reachability
access list 101 permit icmp any host 172.16.23.7 echo
route map MY-LOCAL-POLICY permit 10
set ip next-hop 10.1.1.242
ip local policy route-map MY-LOCAL-POLICY
ip route 0.0.0.0 0.0.0.0 10.1.1.242 track 123
ip route 0.0.0.0 0.0.0.0 10.2.2.125 254
Configuration Example
This example configures the tracking of an interface line-protocol state and verifies the configuration:
Switch(config)# track 33 interface gigabitethernet0/1 line-protocol
Switch(config-track)# end
Interface GigabitEthernet0/1 line-protocol
Line protocol is Down (hw down)
1 change, last change 00:18:28
This example configures track list 4 with a Boolean AND expression that contains two objects with one object state negated. If the list is up, the list detects that object 2 is down:
Switch(config)# track 4 list boolean and
Switch(config-track)# object 1
Switch(config-track)# object 2 not
Switch(config-track)# exit
This example configures track list 4 to track by weight threshold. If object 1 and object 2 are down, then track list 4 is up because object 3 satisfies the up threshold value of 30. But if object 3 is down, both objects 1 and 2 must be up in order to satisfy the threshold weight.
Switch(config)# track 4 list threshold weight
Switch(config-track)# object 1 weight 15
Switch(config-track)# object 2 weight 20
Switch(config-track)# object 3 weight 30
Switch(config-track)# threshold weight up 30 down 10
Switch(config-track)# exit
This configuration can be useful if object 1 and object 2 represent two small bandwidth connections and object 3 represents one large bandwidth connection. The configured down 10 value means that once the tracked object is up, it will not go down until the threshold value is equal to or lower than 10, which in this example means that all connections are down.
This example configures tracked list 4 with three objects and specified percentages to measure the state of the list:
Switch(config)# track 4 list threshold percentage
Switch(config-track)# object 1
Switch(config-track)# object 2
Switch(config-track)# object 3
Switch(config-track)# threshold percentage up 51 down 10
Switch(config-track)# exit
In the following example, the tracking process is configured to track the line-protocol state of GigabitEthernet interface 1/0/0. HSRP on GigabitEthernet interface 0/0/0 then registers with the tracking process to be informed of any changes to the line-protocol state of GigabitEthernet interface 1/0/0. If the line protocol on GigabitEthernet interface 1/0/0 goes down, the priority of the HSRP group is reduced by 10.
Router A:
Device(config)# track 100 interface GigabitEthernet1/0/0 line-protocol
Device(config)# interface GigabitEthernet0/0/0
Device(config-if)# ip address 10.1.0.21 255.255.0.0
Device(config-if)# standby 1 preempt
Device(config-if)# standby 1 ip 10.1.0.1
Device(config-if)# standby 1 priority 110
Device(config-if)# standby 1 track 100 decrement 10
Router B:
Device(config)# track 100 interface GigabitEthernet1/0/0 line-protocol
Device(config)# interface GigabitEthernet0/0/0
Device(config-if)# ip address 10.1.0.22 255.255.0.0
Device(config-if)# standby 1 preempt
Device(config-if)# standby 1 ip 10.1.0.1
Device(config-if)# standby 1 priority 105
Device(config-if)# standby 1 track 100 decrement 10
In the following example, the tracking process is configured to track the IP-routing capability of GigabitEthernet interface 1/0/0. HSRP on GigabitEthernet interface 0/0/0 then registers with the tracking process to be informed of any changes to the IP-routing state of GigabitEthernet interface 1/0/0. If the IP-routing state on GigabitEthernet interface 1/0/0 goes down, the priority of the HSRP group is reduced by 10.
If both serial interfaces are operational, Router A will be the HSRP active router because it has the higher priority. However, if IP on GigabitEthernet interface 1/0/0 in Router A fails, the HSRP group priority will be reduced and Router B will take over as the active router, thus maintaining a default virtual gateway service to hosts on the 10.1.0.0 subnet.
Router A:
Device(config)# track 100 interface GigabitEthernet1/0/0 ip routing
Device(config)# interface GigabitEthernet0/0/0
Device(config-if)# ip address 10.1.0.21 255.255.0.0
Device(config-if)# standby 1 preempt
Device(config-if)# standby 1 ip 10.1.0.1
Device(config-if)# standby 1 priority 110
Device(config-if)# standby 1 track 100 decrement 10
Router B:
Device(config)# track 100 interface GigabitEthernet1/0/0 ip routing
Device(config)# interface GigabitEthernet0/0/0
Device(config-if)# ip address 10.1.0.22 255.255.0.0
Device(config-if)# standby 1 preempt
Device(config-if)# standby 1 ip 10.1.0.1
Device(config-if)# standby 1 priority 105
Device(config-if)# standby 1 track 100 decrement 10
The following example shows how to configure the tracking process to track the state of IP SLAs operation 2:
Switch(config)# track 1 ip sla 2 state
The following example shows how to configure the tracking process to track the reachability of IP SLAs operation 3:
Switch(config)# track 2 ip sla 3 reachability
This example configures Ethernet 1 as a primary interface:
Switch(config)# interface Ethernet 1
Switch(config-if)# description primary
Switch(config-if)# ip address 172.16.16.1 255.255.240.0
The following example configures DHCP on an Ethernet interface and associates tracked object 123 with routes generated from this interface:
ip dhcp client route track 123
This example configures an IP SLAs operation for tracking:
Switch# configure terminal
Switch(config-ip-sla)# icmp-echo 172.29.139.134 source-ip 172.29.139.132
Switch(config-ip-sla-echo)# frequency 300
Switch(config-ip-sla-echo)# exit
Switch(config)# ip sla schedule 10 life forever start-time now
Switch(config)# track 2 ip sla 3 reachability
Switch(config)# end
The following example configures a routing policy for backup static routing by using object tracking:
ip address 209.165.202.129 255.255.255.255
ip address 209.165.200.225 255.255.255.255
type echo protocol ipIcmpEcho 172.16.23.7
ip sla monitor schedule 1 life forever start-time now
track 123 ip sla 1 reachability
access list 101 permit icmp any host 172.16.23.7 echo
route map MY-LOCAL-POLICY permit 10
set ip next-hop 10.1.1.242
ip local policy route-map MY-LOCAL-POLICY
ip route 0.0.0.0 0.0.0.0 10.1.1.242 track 123
ip route 0.0.0.0 0.0.0.0 10.2.2.125 254