Skip to content

HSRP

HSRP (Hot Standby Router Protocol) provides first-hop gateway redundancy for IP networks on NX-OS, enabling automatic failover between active and standby routers to maintain uninterrupted traffic forwarding for connected hosts. Global HSRP settings control BFD integration for fast failure detection and extended hold interval tuning for timer-based failover behavior, configured under the system section. HSRP interface-level configuration supports version 1/2, group definitions with IPv4/IPv6 address families, priority-based election, preemption with configurable delays, md5 or text authentication, hello/hold interval tuning, and MAC address customization across VLAN, Ethernet, port-channel interfaces, and Ethernet/port-channel subinterfaces.

Diagram
NameTypeConstraintMandatoryDefault Value
hsrp_bfdBooleantrue, falseNo
hsrp_timers_extended_holdIntegermin: 10, max: 255No

vlans (nxos.devices.configuration.interfaces)

Section titled “vlans (nxos.devices.configuration.interfaces)”
NameTypeConstraintMandatoryDefault Value
hsrpClass[hsrp]No

ethernets (nxos.devices.configuration.interfaces)

Section titled “ethernets (nxos.devices.configuration.interfaces)”
NameTypeConstraintMandatoryDefault Value
hsrpClass[hsrp]No

port_channels (nxos.devices.configuration.interfaces)

Section titled “port_channels (nxos.devices.configuration.interfaces)”
NameTypeConstraintMandatoryDefault Value
hsrpClass[hsrp]No

subinterfaces (nxos.devices.configuration.interfaces.ethernets)

Section titled “subinterfaces (nxos.devices.configuration.interfaces.ethernets)”
NameTypeConstraintMandatoryDefault Value
hsrpClass[hsrp]No

hsrp (nxos.devices.configuration.interfaces.vlans)

Section titled “hsrp (nxos.devices.configuration.interfaces.vlans)”
NameTypeConstraintMandatoryDefault Value
versionIntegermin: 1, max: 2No
bfdBooleantrue, falseNo
use_biaBooleantrue, falseNo
use_bia_scopeChoiceglobal, localNo
delay_minimumIntegermin: 0, max: 10000No
delay_reloadIntegermin: 0, max: 10000No
mac_refreshIntegermin: 0, max: 10000No
groupsList[groups]No

groups (nxos.devices.configuration.interfaces.vlans.hsrp)

Section titled “groups (nxos.devices.configuration.interfaces.vlans.hsrp)”
NameTypeConstraintMandatoryDefault Value
idIntegermin: 0, max: 4095Yes
address_familyChoiceipv4, ipv6Yes
authentication_md5_compatibilityBooleantrue, falseNo
authentication_md5_key_chainStringNo
authentication_md5_key_stringStringNo
authentication_md5_key_string_typeChoiceunencrypted, hiddenNo
authentication_md5_timeoutIntegermin: 0, max: 32767No
authentication_md5_typeChoicekey-chain, key-stringNo
authentication_textStringNo
authentication_typeChoicesimple, md5No
followStringNo
forwarding_threshold_lowerIntegermin: 0, max: 255No
timers_hello_intervalIntegermin: 250, max: 254000No
timers_hold_intervalIntegermin: 750, max: 255000No
ipStringNo
mac_addressStringNo
nameStringNo
preemptBooleantrue, falseNo
preempt_delay_minimumIntegermin: 0, max: 3600No
preempt_delay_reloadIntegermin: 0, max: 3600No
preempt_delay_syncIntegermin: 0, max: 3600No
priorityIntegermin: 0, max: 255No

Example 1: Basic HSRP on tenant SVIs with BFD and active/standby pair

nxos:
devices:
- name: LEAF1
configuration:
system:
hsrp_bfd: true
interfaces:
vlans:
- id: 1010
vrf: BLUE
hsrp:
version: 2
groups:
- id: 10
address_family: ipv4
ip: 192.168.1.1
priority: 110
preempt: true

Example 2: Dual-SVI HSRP with BFD, preempt delays, and authentication

nxos:
devices:
- name: LEAF1
configuration:
system:
hsrp_bfd: true
interfaces:
vlans:
- id: 1010
vrf: BLUE
hsrp:
version: 2
delay_minimum: 5
delay_reload: 10
groups:
- id: 10
address_family: ipv4
ip: 192.168.1.1
priority: 110
preempt: true
preempt_delay_minimum: 30
authentication_type: md5
authentication_md5_type: key-string
authentication_md5_key_string: HSRP-BLUE
- id: 1020
vrf: GREEN
hsrp:
version: 2
groups:
- id: 20
address_family: ipv4
ip: 192.168.2.1
priority: 110
preempt: true
preempt_delay_minimum: 30
authentication_type: md5
authentication_md5_type: key-string
authentication_md5_key_string: HSRP-GREEN

Example 3: HSRP standby peer with BFD, extended hold timer, and IPv6 group

nxos:
devices:
- name: LEAF2
configuration:
system:
hsrp_bfd: true
hsrp_timers_extended_hold: 30
interfaces:
vlans:
- id: 1010
vrf: BLUE
hsrp:
version: 2
groups:
- id: 10
address_family: ipv4
ip: 192.168.1.1
priority: 90
preempt: true
preempt_delay_minimum: 30
authentication_type: md5
authentication_md5_type: key-string
authentication_md5_key_string: HSRP-BLUE
- id: 10
address_family: ipv6
ip: 2001:db8:1::1
priority: 90
preempt: true

Example 4: HSRP on Ethernet subinterfaces with BFD for multi-tenant L3 gateway redundancy

nxos:
devices:
- name: BORDER1
configuration:
system:
hsrp_bfd: true
interfaces:
ethernets:
- id: 1/1
switchport: false
subinterfaces:
- id: 100
vrf: TENANT-A
encapsulation: "100"
hsrp:
version: 2
groups:
- id: 1
address_family: ipv4
ip: 192.168.1.1
priority: 110
preempt: true
- id: 200
vrf: TENANT-B
encapsulation: "200"
hsrp:
version: 2
groups:
- id: 2
address_family: ipv4
ip: 192.168.2.1
priority: 110
preempt: true