Skip to content

Router HSRP

HSRP is a first-hop redundancy protocol that enables multiple routers to share a virtual IP and MAC address, providing transparent failover for hosts without requiring router discovery. An active router handles forwarding while a standby router monitors its health and takes over seamlessly if the active router fails. IOS-XR supports HSRP on Ethernet interfaces, sub-interfaces, and link bundles, with IPv4 (version 1 and 2) and IPv6 (version 2) address families.

Diagram
NameTypeConstraintMandatoryDefault Value
router_hsrpClass[router_hsrp]No

NameTypeConstraintMandatoryDefault Value
interfacesList[interfaces]No

interfaces (iosxr.devices.configuration.router_hsrp)

Section titled “interfaces (iosxr.devices.configuration.router_hsrp)”
NameTypeConstraintMandatoryDefault Value
nameStringRegex: ^(FastEthernet|GigabitEthernet|TenGigE|TwentyFiveGigE|FortyGigE|FiftyGigE| HundredGigE|TwoHundredGigE|FourHundredGigE|EightHundredGigE|BVI|Bundle-Ether| Bundle-POS|CEM|GCC[0-2]|Loopback|MgmtEth|Multilink|Null|POS|PW-Ether|SRP|lpts| nve|preconfigure|tunnel-ip|tunnel-ipsec|tunnel-mte|tunnel-te|tunnel-tp)\d+(/\d+)*(\.\d+)?$Yes
use_biaBooleantrue, falseNo
redirects_disableBooleantrue, falseNo
delay_minimumIntegermin: 0, max: 10000No
delay_reloadIntegermin: 0, max: 10000No
bfd_minimum_intervalIntegermin: 3, max: 30000No
bfd_multiplierIntegermin: 2, max: 50No
mac_refreshIntegermin: 0, max: 10000No
ipv4List[ipv4]No
ipv6List[ipv6]No

ipv4 (iosxr.devices.configuration.router_hsrp.interfaces)

Section titled “ipv4 (iosxr.devices.configuration.router_hsrp.interfaces)”
NameTypeConstraintMandatoryDefault Value
groupIntegermin: 0, max: 4095Yes
versionChoice1, 2No
addressIPNo
address_learnBooleantrue, falseNo
priorityIntegermin: 0, max: 255No
preempt_delayIntegermin: 0, max: 3600No
timers_secondsIntegermin: 1, max: 255No
timers_seconds_holdtimeIntegermin: 1, max: 255No
timers_msecIntegermin: 100, max: 3000No
timers_msec_holdtimeIntegermin: 100, max: 3000No
mac_addressStringNo
nameStringNo
bfd_fast_detect_peer_ipv4IPNo
bfd_fast_detect_peer_interfaceStringRegex: ^(FastEthernet|GigabitEthernet|TenGigE|TwentyFiveGigE|FortyGigE|FiftyGigE| HundredGigE|TwoHundredGigE|FourHundredGigE|EightHundredGigE|BVI|Bundle-Ether| Bundle-POS|CEM|GCC[0-2]|Loopback|MgmtEth|Multilink|Null|POS|PW-Ether|SRP|lpts| nve|preconfigure|tunnel-ip|tunnel-ipsec|tunnel-mte|tunnel-te|tunnel-tp)\s?\d+(/[A-Z0-9]+)*(\.\d+)?$No
secondary_ipv4_addressesList[secondary_ipv4_addresses]No
track_interfacesList[track_interfaces]No
track_objectsList[track_objects]No

ipv6 (iosxr.devices.configuration.router_hsrp.interfaces)

Section titled “ipv6 (iosxr.devices.configuration.router_hsrp.interfaces)”
NameTypeConstraintMandatoryDefault Value
groupIntegermin: 0, max: 4095Yes
addressesList[addresses]No
linklocal_addressIPNo
linklocal_address_autoconfigBooleantrue, falseNo
linklocal_address_autoconfig_legacyBooleantrue, falseNo
priorityIntegermin: 0, max: 255No
preempt_delayIntegermin: 0, max: 3600No
timers_secondsIntegermin: 1, max: 255No
timers_seconds_holdtimeIntegermin: 1, max: 255No
timers_msecIntegermin: 100, max: 3000No
timers_msec_holdtimeIntegermin: 100, max: 3000No
mac_addressStringNo
nameStringNo
bfd_fast_detect_peer_ipv6IPNo
bfd_fast_detect_peer_interfaceStringRegex: ^(FastEthernet|GigabitEthernet|TenGigE|TwentyFiveGigE|FortyGigE|FiftyGigE| HundredGigE|TwoHundredGigE|FourHundredGigE|EightHundredGigE|BVI|Bundle-Ether| Bundle-POS|CEM|GCC[0-2]|Loopback|MgmtEth|Multilink|Null|POS|PW-Ether|SRP|lpts| nve|preconfigure|tunnel-ip|tunnel-ipsec|tunnel-mte|tunnel-te|tunnel-tp)\s?\d+(/[A-Z0-9]+)*(\.\d+)?$No
track_interfacesList[track_interfaces]No
track_objectsList[track_objects]No

secondary_ipv4_addresses (iosxr.devices.configuration.router_hsrp.interfaces.ipv4)

Section titled “secondary_ipv4_addresses (iosxr.devices.configuration.router_hsrp.interfaces.ipv4)”
NameTypeConstraintMandatoryDefault Value
addressIPYes

track_interfaces (iosxr.devices.configuration.router_hsrp.interfaces.ipv4)

Section titled “track_interfaces (iosxr.devices.configuration.router_hsrp.interfaces.ipv4)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
priority_decrementIntegermin: 1, max: 255Yes

track_objects (iosxr.devices.configuration.router_hsrp.interfaces.ipv4)

Section titled “track_objects (iosxr.devices.configuration.router_hsrp.interfaces.ipv4)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
priority_decrementIntegermin: 1, max: 255Yes

addresses (iosxr.devices.configuration.router_hsrp.interfaces.ipv6)

Section titled “addresses (iosxr.devices.configuration.router_hsrp.interfaces.ipv6)”
NameTypeConstraintMandatoryDefault Value
addressIPYes

track_interfaces (iosxr.devices.configuration.router_hsrp.interfaces.ipv6)

Section titled “track_interfaces (iosxr.devices.configuration.router_hsrp.interfaces.ipv6)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
priority_decrementIntegermin: 1, max: 255Yes

track_objects (iosxr.devices.configuration.router_hsrp.interfaces.ipv6)

Section titled “track_objects (iosxr.devices.configuration.router_hsrp.interfaces.ipv6)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
priority_decrementIntegermin: 1, max: 255Yes

The version field on IPv4 groups controls which HSRP version is used. If version is omitted, it defaults to 2.

  • version: 1 — Group ID range 0-255, maps to HSRP version 1
  • version: 2 (default) — Group ID range 0-4095, maps to HSRP version 2

IPv6 groups are always version 2; the version field is not applicable and should be omitted.

MAC Address Formats

Fields that accept MAC addresses can be in any of three formats:

  1. colon-separated (e.g., "01:01:01:01:01:01")
  2. dash-separated (e.g., "01-01-01-01-01-01")
  3. dotted (e.g., "0101.0101.0101")

All 3 formats can be used interchangeably. The normalization layer converts the user-specified format to colon-separated before sending to the device.

Example-1: Active/standby gateway pair on a data center VLAN interface with BFD-accelerated failover and uplink tracking

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
router_hsrp:
interfaces:
- name: Bundle-Ether10.100
redirects_disable: true
delay_minimum: 300
delay_reload: 600
bfd_minimum_interval: 15000
bfd_multiplier: 3
mac_refresh: 3600
ipv4:
- group: 100
version: 2
address: 172.16.100.1
priority: 150
preempt_delay: 180
timers_msec: 250
timers_msec_holdtime: 750
name: DC_VLAN100_GW
bfd_fast_detect_peer_ipv4: 172.16.100.3
bfd_fast_detect_peer_interface: Bundle-Ether10.100
secondary_ipv4_addresses:
- address: 172.16.100.2
track_interfaces:
- name: TenGigE0/0/0/0
priority_decrement: 60
track_objects:
- name: UPSTREAM_REACHABILITY
priority_decrement: 80

Example-2: Dual-stack with IPv4 and IPv6 HSRP on the same interface

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
router_hsrp:
interfaces:
- name: TenGigE0/0/0/1.200
delay_minimum: 200
delay_reload: 400
bfd_minimum_interval: 15000
bfd_multiplier: 3
ipv4:
- group: 200
address: 10.200.0.1
priority: 120
preempt_delay: 60
timers_seconds: 3
timers_seconds_holdtime: 10
name: V200
track_interfaces:
- name: TenGigE0/0/0/0
priority_decrement: 30
ipv6:
- group: 200
addresses:
- address: "2001:db8:200::1"
linklocal_address: "fe80::1"
priority: 120
preempt_delay: 60
timers_seconds: 3
timers_seconds_holdtime: 10
name: V200_V6
track_interfaces:
- name: TenGigE0/0/0/0
priority_decrement: 30

Example-3: Single IPv4 gateway with default version (2)

iosxr:
devices:
- name: router-1
host: 10.10.10.1:57400
configuration:
router_hsrp:
interfaces:
- name: GigabitEthernet0/0/0/0
ipv4:
- group: 1
address: 192.168.1.1
priority: 110