priority [value] forwarding-threshold lower [l] upper [u]
Configures HSRP priority and sets forwarding thresholds to control active router election and preemption behavior.
Overview
The 'priority [value] forwarding-threshold lower [l] upper [u]' command in Cisco NX-OS configures HSRP priority and forwarding thresholds on a per-group basis. HSRP (Hot Standby Router Protocol) provides first-hop redundancy by allowing multiple routers to share a virtual IP address, with one router acting as the active forwarder and others as standby. The priority value (0-255) determines which router becomes active; higher priority is preferred. Forwarding thresholds refine this behavior when preemption is enabled. The lower threshold defines the priority level below which the router will stop forwarding traffic and transition to standby state. The upper threshold defines the priority level above which the router can become active (if it was previously standby). This prevents constant role changes due to minor priority fluctuations. On Cisco NX-OS (Nexus), this command is available in HSRP configuration mode (config-if-hsrp). It is commonly used in data center environments where stability and predictable failover are critical. The command fits into troubleshooting workflows when investigating unexpected active router changes or flapping. By examining the configured thresholds and current priority, engineers can determine if preemption is causing instability or if thresholds are set too tightly.
priority [value] forwarding-threshold lower [l] upper [u]When to Use This Command
- Ensure a specific router becomes active by setting a higher priority and appropriate thresholds.
- Prevent flapping by setting lower and upper thresholds that require significant degradation before switching.
- Load balance traffic across multiple HSRP groups by adjusting priorities and thresholds.
- Control preemption so that a router only takes over when its priority exceeds the upper threshold.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| value | 0-255 | Sets the HSRP priority for the group. Higher values increase the likelihood of becoming the active router. Default is 100. |
| l | 0-255 | Lower forwarding threshold. If the priority drops below this value, the router stops forwarding and becomes standby. Must be less than the upper threshold. |
| u | 0-255 | Upper forwarding threshold. If the priority rises above this value, the router can become active (if preemption is enabled). Must be greater than the lower threshold. |
Command Examples
Set priority and forwarding thresholds
interface vlan 10
ip address 192.168.10.2/24
hsrp 1
priority 150 forwarding-threshold lower 100 upper 140interface Vlan10
ip address 192.168.10.2/24
hsrp 1
priority 150
forwarding-threshold lower 100 upper 140Sets HSRP priority to 150, with lower threshold 100 and upper threshold 140. The router will be active if its priority is above 140; it will become standby if priority drops below 100.
Default thresholds (no explicit configuration)
interface vlan 10
ip address 192.168.10.2/24
hsrp 1
priority 100interface Vlan10
ip address 192.168.10.2/24
hsrp 1
priority 100
forwarding-threshold lower 1 upper 100Default thresholds: lower=1, upper=priority (100). The router will be active if priority is 100 or above; it will become standby if priority drops below 1 (effectively never).
Understanding the Output
The output shows the HSRP configuration for the interface. The 'priority' field indicates the configured priority value. The 'forwarding-threshold lower' and 'upper' fields show the thresholds. The lower threshold is the priority value below which the router will stop forwarding (become standby). The upper threshold is the priority value above which the router can become active (if preemption is enabled). Healthy values: priority above upper threshold ensures active role; priority between lower and upper maintains current role. Problem values: priority below lower threshold causes standby state; priority between thresholds may cause instability if preemption is enabled.
Configuration Scenarios
Stable Active Router with Preemption
Two Nexus switches (Nexus-A and Nexus-B) in an HSRP group for VLAN 10. Nexus-A should be active unless its priority drops significantly.
Topology
[Nexus-A] --- [Nexus-B]
| |
[VLAN 10] [VLAN 10]Steps
- 1.Configure HSRP on Nexus-A with priority 150, lower threshold 100, upper threshold 140.
- 2.Configure HSRP on Nexus-B with priority 100 (default).
- 3.Enable preemption on both routers.
! Nexus-A
interface Vlan10
ip address 192.168.10.2/24
hsrp 1
priority 150 forwarding-threshold lower 100 upper 140
preempt
! Nexus-B
interface Vlan10
ip address 192.168.10.3/24
hsrp 1
priority 100
preemptVerify: Use 'show hsrp 1' to verify active router and priority. Nexus-A should be active with priority 150. If Nexus-A's priority drops to 130 (between thresholds), it remains active. If it drops to 90 (below lower), Nexus-B becomes active.
Watch out: If preemption is not enabled, thresholds have no effect; the active router remains active until it fails.
Troubleshooting with This Command
When troubleshooting HSRP issues on Cisco NX-OS, the 'priority forwarding-threshold' command is key to understanding active router selection and preemption behavior. Start by checking the current HSRP state with 'show hsrp'. Look for the priority and threshold values. If the active router is not the expected one, verify that preemption is enabled on the router with higher priority. If the active router is flapping, examine the thresholds: if the priority is fluctuating around the lower or upper threshold, it can cause repeated state changes. Use 'show hsrp brief' to see all groups and their states. Check interface tracking if configured, as tracked objects can dynamically change priority. On NX-OS, you can also use 'show hsrp statistics' to see state transitions. If thresholds are set too close together (e.g., lower 140, upper 150), minor priority changes can trigger preemption. Ensure lower < upper and that the gap is sufficient to absorb normal fluctuations. Also verify that the priority value itself is not being changed by other mechanisms (e.g., interface tracking). Finally, confirm that both routers have consistent HSRP configuration (group number, virtual IP, timers).
CCNA Exam Tips
Remember that default lower threshold is 1 and upper threshold equals the priority value.
Thresholds are only relevant when preemption is enabled; without preemption, the active router remains active until it fails.
On NX-OS, the 'forwarding-threshold' command is used in HSRP configuration mode; it is not available in all IOS versions.
Common Mistakes
Setting lower threshold higher than upper threshold – this is invalid and will be rejected.
Forgetting to enable preemption – thresholds have no effect without preemption.
Confusing thresholds with priority – priority determines initial active election; thresholds control when preemption occurs.
Platform Notes
On Cisco NX-OS (Nexus), the 'forwarding-threshold' command is supported in HSRP configuration mode. This is similar to Cisco IOS, but on IOS the command is 'hsrp [group] priority [value] preempt [delay]' with thresholds configured via 'hsrp [group] preempt threshold [lower] [upper]'. NX-OS combines priority and thresholds in one command. On IOS, thresholds are part of the preempt command. On NX-OS, preemption is enabled separately with 'preempt'. The default thresholds on NX-OS are lower=1, upper=priority. On IOS, default thresholds are lower=1, upper=priority as well. For other platforms like Arista EOS, HSRP is not supported (they use VARP). On Juniper Junos, VRRP is used with similar threshold concepts. Version differences: NX-OS 7.0 and later support this command; earlier versions may require different syntax. Always check the specific NX-OS version documentation.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions