This article provides instructions on how to configure the IP SLA tracking settings for IPv4 static routes on your switch. In this scenario, the static route has been preconfigured.
Note: To learn how to configure an IPv4 static route on your switch, click here. For instructions on how to configure IP SLA tracking for IPv4 static routes through the web-based utility, click here.
When using static routing, you may experience a situation where a static route is active, but the destination network is not reachable via the specified next hop. For example, if the static route in question has the lowest metric to the destination network and the status of the outgoing interface to the next hop is Up, however the connectivity is broken somewhere along the path to the destination network. In this case, the device can use the static route although it does not actually provide connectivity to the destination network. The Internet Protocol Service Level Agreement (IP SLA) Object tracking for static routes provides a mechanism to track the connectivity to the destination network via the next hop specified in the static route. If connectivity to the destination network is lost, the route state is set to Down, and if available, a different static route (which is in state Up) can be selected for routing traffic.
Similar to IP SLAs tracking for Virtual Router Redundancy Protocol (VRRP), IP SLAs object tracking for static routes also relies on IP SLAs operations to detect connectivity to destination networks. IP SLAs operation sends Internet Control Message Protocol (ICMP) packets to the address defined by the user (a host on the required destination network), and also defines the next hop to use for the ping operation. IP SLAs operation then monitors success or failure of replies from the host. A track object is used to track operation results and set the status to Up or Down, based on the success or failure of the ICMP destination. The track operation is assigned to a static route. If the track status is down, the static route state is set to Down. If track status is Up, the static route state remains Up.
The following describes the main terms used in this article:
Operation Return Code |
Track Operation State |
OK |
Up |
Error |
Down |
Note: If the IP SLAs operation specified by the track argument is not configured or is its schedule is pending, its state is OK. An application that is bound to a non-existing tracking object will receive the Up state.
Step 1. Log in to the switch console. The default username and password is cisco/cisco. If you have configured a new username or password, enter the credentials instead.
Note: To learn how to access an SMB switch CLI through SSH or Telnet, click here.
Note: The commands may vary depending on the exact model of your switch. In this example, SG550XG-24T is used.
Step 2. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
SG550XG#configureStep 3. To begin configuring an IP SLA operation and enter IP SLA configuration mode, enter the following:
SG550XG(config)#ip sla [operation]Note: You cannot configure a new IP SLAs operation with a number of an existing IP SLAs operation. You must first delete the existing IP SLAs operation.
Note: In this example, IP SLA operation 1 is created.
Step 4. (Optional) To remove an existing IP SLA operation, enter the following:
SG550XG(config)#noip sla [operation]Step 5. To configure an IP SLA ICMP Echo operation, enter the following:
SG550XG(config-ip-sla)#icmp-echo [ip-address | hostname] {{[source-ip ip-address] [nexthop-ip ip-address]}}Note: In this example, the operation target IP address is 192.168.1.1, the source IP address is 192.168.100.126, and the next hop IP address is 192.168.100.1.
Step 6. To set the protocol data size in the payload of the request packet of an IP SLA operation, enter the following:
SG550XG(config-ip-sla-icmp-echo)#request-data-size [bytes]Note: The default request packet data size for an ICMP Echo operation is 28 bytes. This data size is the payload portion of the ICMP packet, which makes a 64-byte IP packet.
Note: In this example, the request data size is set to 32 bytes.
Step 7. To set the rate at which a specified IP SLA operation repeats, enter the following:
SG550XG(config-ip-sla-icmp-echo)#frequency [seconds]Note: A single IP SLA operation will repeat at a given frequency for the lifetime of the operation. If you configure the frequency, the timeout must be configured as well. The new frequency value configured by this command will impact on the current frequency interval.
Note: In this example, the frequency is set to 30 seconds.
Step 8. To set the amount of time an IP SLA operation waits for a response to its request packet, enter the following:
SG550XG(config-ip-sla-icmp-echo)#timeout [milliseconds]Note: In this example, the timeout is set to 1000 milliseconds.
Step 9. Enter the exit command to exit the IP SLA ICMP Echo context:
SG550XG(config-ip-sla-icmp-echo)#exitStep 10. To configure the scheduling parameters for a single IP SLA operation, enter the following:
SG550XG(config-ip-sla)#ip sla schedule [operation] life forever start-time nowNote: In this example, operation 1 is configured to run indefinitely and scheduled to start immediately.
Step 11. (Optional) To display the information about all IP SLA operations or a specific operation, enter the following:
SG550XG#show ip sla operation [operation]Note: In this example, IP SLA information for operation 1 is displayed.
You should now have successfully configured and displayed the ICMP Echo statistics of a specific SLA operation on your switch.
Step 1. From the Privileged EXEC mode of the switch, enter the Global Configuration mode by entering the following:
SG550XG#configureStep 2. To track the state of an IP SLA operation and to enter tracking configuration mode, enter the following:
SG550XG(config)#track [object-id] ip sla [operation] stateNote: In this example, object ID 1 is created and associated with operation 1.
Step 3. To configure a period of time in seconds to delay state changes of a tracking object, enter the following:
SG550XG(config-track)#delay {{up [seconds] down [seconds] | up [seconds] | down [seconds]}}Note: In this example, the up delay is set to five seconds and the down delay is set to two seconds.
Step 4. (Optional) To clear the IP SLA counters, enter the following:
SG550XG(config)#clear ip sla counters [operation]Step 5. Enter the end command to go back to the Privileged EXEC mode:
Step 6. (Optional) To display the information about all tracking objects or a specific tracking object, enter the following:
SG550XG(config)#show track [track-id]Note: In this example, IP SLA tracking information for object 1 is displayed.
Step 7. (Optional) In the Privileged EXEC mode of the switch, save the configured settings to the startup configuration file by entering the following:
SG550XG#copy running-config startup-configStep 8. (Optional) Press Y for Yes or N for No on your keyboard once the Overwrite file [startup-config] prompt appears.
You should now have successfully configured the IP SLA tracking settings for IPv4 static routes on your switch.
Revision | Publish Date | Comments |
---|---|---|
1.0 |
13-Dec-2018 |
Initial Release |