HSRP commands

HSRP sessions are not up by default. You can configure upto 255 (IPv4 and IPv6 combined) HSRP sessions per router with the help of the command, hw-module vrrpscale enable. For more information about the command, see HSRP Commands in the IP Addresses and Services Command Reference for Cisco NCS 5500 Series and NCS 540 and NCS 560 Series Routers.

HSRP group configuration is configured on a specified interface and the subordinate groups configured inherits the state of the specified interface on which the HSRP group configuration is configured.


Note


All commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540 Series Router that is introduced from Cisco IOS XR Release 6.3.2. References to earlier releases in Command History tables apply to only the Cisco NCS 5500 Series Router.



Note


  • Starting with Cisco IOS XR Release 6.6.25, all commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 560 Series Routers.

  • Starting with Cisco IOS XR Release 6.3.2, all commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540 Series Router.

  • References to releases before Cisco IOS XR Release 6.3.2 apply to only the Cisco NCS 5500 Series Router.

  • Cisco IOS XR Software Release 7.0.1 specific updates are not applicable for the following variants of Cisco NCS 540 Series Routers:

    • N540-28Z4C-SYS-A

    • N540-28Z4C-SYS-D

    • N540X-16Z4G8Q2C-A

    • N540X-16Z4G8Q2C-D

    • N540X-16Z8Q2C-D

    • N540-12Z20G-SYS-A

    • N540-12Z20G-SYS-D

    • N540X-12Z16G-SYS-A

    • N540X-12Z16G-SYS-D


This chapter describes the Cisco IOS XR software commands used to configure and monitor the Hot Standby Router Protocol (HSRP).

For detailed information about HSRP concepts, configuration tasks, and examples, refer to the IP Addresses and Services Configuration Guide for Cisco NCS 5500 Series RoutersIP Addresses and Services Configuration Guide for Cisco NCS 540 Series RoutersIP Addresses and Services Configuration Guide for Cisco NCS 560 Series Routers.

address (hsrp)

To enable hot standby protocol for IP, use the address (hsrp) command in the HSRP group submode. To disable hot standby protocol for IP, use the no form of this command.

address { learn | address }

no address { learn | address }

Syntax Description

learn

Learns virtual IP address from peer.

address

Hot standby IP address.

Command Default

None

Command Modes

HSRP Group Submode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read, write

Examples

This example shows how to enable a group to learn the primary virtual IPv4 address from received HSRP control packets:

Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE hundredgige 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 1 version 2
Router(config-hsrp-gp)# address learn
Router(config-hsrp-gp)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

address global (HSRP)

To configure the global virtual IPv6 address for the HSRP group, use the address global command in the virtual router submode. To deconfigure the global virtual IPv6 address for the HSRP group, use the no form of this command.

address global ipv6-address

no address global ipv6-address

Syntax Description

ipv6-address

Global HSRP IPv6 address.

Command Default

None

Command Modes

HSRP Group Submode, under the IPv6 address-family

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read,write

Examples

This example shows how to add a global virtual IPv6 address for the HSRP group:


Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv6
Router(config-hsrp-address-family)# hsrp 3 
Router(config-hsrp-virtual-router)# address global 4000::1000 
Router(config-hsrp-virtual-router)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

address global subordinate (HSRP)

To configure the global virtual IPv6 address for the subordinate group, use the address global command in the HSRP slave submode. To deconfigure the global virtual IPv6 address for the subordinate group, use the no form of this command.

address global ipv6-address

no address global ipv6-address

Syntax Description

ipv6-address

Global VRRP IPv6 address.

Command Default

None

Command Modes

HSRP Slave Submode, under the IPv6 address-family

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read,write

Examples

This example shows how to add a global virtual IPv6 address for the subordinate group:


Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv6
Router(config-hsrp-address-family)# hsrp 3 slave
Router(config-hsrp-virtual-router)# address global 4000::1000 
Router(config-hsrp-virtual-router)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

address linklocal(HSRP)

To either configure the virtual link-local IPv6 address for the HSRP group or to specify that the virtual link-local IPv6 address should be enabled and calculated automatically from the virtual router virtual Media Access Control (MAC) address, use the address linklocal command in the HSRP group submode, under the IPv6 address-family. To deconfigure the virtual link-local IPv6 address forthe HSRP group, use the no form of this command.

address linklocal ipv6-address | autoconfig

no address linklocal ipv6-address | autoconfig

Syntax Description

ipv6-address

HSRP IPv6 link-local address.

autoconfig

Autoconfigures the HSRP IPv6 link-local address.

Command Default

None

Command Modes

  HSRP Group Submode, under the IPv6 address-family

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

When you configure HSRP for IPv6, you must also configure the linklocal IPv6 address using either the ipv6-address argument or the autoconfig keyword. If you configure only the global IPv6 address and commit the changes using the commit keyword, the router does not accept the configuration and displays an error message.

Task ID

Task ID Operation
hsrp

read, write

Examples

This example shows how to autoconfigure the HSRP IPv6 link-local address:


Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv6
Router(config-hsrp-address-family)# hsrp 3 version 2 
Router(config-hsrp-virtual-router)# address linklocal autoconfig 
Router(config-hsrp-virtual-router)#

This example shows how to configure the virtual link-local IPv6 address for the HSRP group:

Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv6
Router(config-hsrp-address-family)# hsrp 3 
Router(config-hsrp-virtual-router)# address linklocal FE80::260:3EFF:FE11:6770 
Router(config-hsrp-virtual-router)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

address secondary (hsrp)

To configure the secondary virtual IPv4 address for a virtual router, use the address secondary command in the Hot Standby Router Protocol (HSRP) virtual router submode. To deconfigure the secondary virtual IPv4 address for a virtual router, use the no form of this command.

address address secondary

no address address secondary

Syntax Description

secondary

Sets the secondary HSRP IP address.

address

HSRP IPv4 address.

Command Default

None

Command Modes

HSRP virtual router

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read, write

Examples

This example shows how to set the secondary virtual IPv4 address for the virtual router:

Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 3 version 2
Router(config-hsrp-gp)# address 10.20.30.1 secondary
Router(config-hsrp-gp)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

authentication (hsrp)

To configure an authentication string for the Hot Standby Router Protocol (HSRP), use the hsrp authentication command in HSRP group submode. To delete an authentication string, use the no form of this command.

authentication string

no authentication [string]

Syntax Description

string

Authentication string. It can be up to eight characters long. The default is 'cisco'.

Command Default

The default authentication string is cisco.

Command Modes

HSRP Group Submode

Command History

Release

Modification

Release 7.1.1

This command was introduced. This command replaces the hsrp authentication command.

Usage Guidelines

The authentication string is sent unencrypted in all HSRP messages. The same authentication string must be configured on all routers and access servers on a LAN to ensure interoperation. Authentication mismatch prevents a device from learning the designated Hot Standby IP address and the Hot Standby timer values from other routers configured with HSRP.

The hsrp authentication command is available for version 1 groups only

Task ID

Task ID

Operations

hsrp

read, write

Examples

This example shows how to configure “company1” as the authentication string required to allow Hot Standby routers in group 1 on tengige hundredgige interface 0/4/0/4 to interoperate:

Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 1 version 1 
Router(config-hsrp-gp)# authentication company1
Router(config-hsrp-gp)#


Note


The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.


bfd fast-detect (hsrp)

To enable bidirectional forwarding(BFD) fast-detection on a HSRP interface, use the hsrp bfd fast-detect command in HSRP group submode. This creates a BFD session between the HSRP router and its peer, and if the session goes down while HSRP is in backup state, this will initiate a HSRP failover. To disable BFD fast-detection, use the no form of this command.

hsrp group number bfd fast-detect

Syntax Description

group number group number

(Optional)

HSRP group number. Range is 0 to 255.

Command Default

BFD is disabled.

Command Modes

HSRP interface configuration

Command History

Release

Modification

Release 7.2.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

hsrp

read, write

Examples

This example shows how to enable bfd fast-detect:



RP/0/RP0/CPU0:router# configure 
RP/0/RP0/CPU0:router(config)# router hsrp 
RP/0/RP0/CPU0:router(config-hsrp)# interface gig 0/1/1/0
RP/0/RP0/CPU0:router(config-hsrp-if)# hsrp 1 bfd fast-detect


clear hsrp statistics

To reset the Hot Standby Routing Protocol Statistics (HSRP) statistics to zero, use the clear hsrp statistics command in XR EXEC mode.

clear hsrp statistics [ interface interface-type interface-path-id group ]

Syntax Description

interface interface-path-id

Physical interface or virtual interface.

Note

 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

group

(Optional) Group number.

Command Default

None

Command Modes

XR EXEC mode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read, write

Examples

This sample output is from the clear hsrp statistics command:



Router# clear hsrp statistics

hsrp bfd minimum-interval

To configure the BFD minimum interval to be used for all VRRP BFD sessions on a given interface, use the bfd minimum-interval command in the interface configuration mode. To remove the configured minimum-interval period and set the minimum-interval period to the default period, use the no form of this command.

hsrp bfd minimum-interval interval

Syntax Description

interval

Specify the minimum-interval in milliseconds. Range is 15 to 30000.

Command Default

Default minimum interval is 50 ms.

Command Modes

HSRP interface configuration

Command History

Release Modification

Release 7.2.1

This command was introduced.

Usage Guidelines

Minimum interval determines the frequency of sending BFD packets to BFD peers. It is the time between successive BFD packets sent for the session. Minimum interval is defined in milliseconds. The configured minimum interval applies to all BFD sessions on the interface.

Task ID

Task ID

Operations

hsrp

read, write

Examples

The following example shows how to configure a minimum interval of 100 milliseconds:


RP/0/RP0/CPU0:router(config)# router hsrp
RP/0/RP0/CPU0:router(config-hsrp)# interface gig 0/1/1/0
RP/0/RP0/CPU0:router(config-hsrp-if)# hsrp bfd minimum-interval 100

hsrp bfd multiplier

To set the BFD multiplier value, use the bfd multiplier command in the interface configuration mode. To remove the configured multiplier value and set the multiplier to the default value, use the no form of this command.

hsrp bfd multiplier multiplier

Syntax Description

multiplier

Specifies the BFD multiplier value. Range is 2 to 50.

Command Default

Default value is 3.

Command Modes

HSRP interface configuration

Command History

Release Modification

Release 7.2.1

This command was introduced.

Usage Guidelines

The multiplier value specifies the number of consecutive BFD packets that, if not received as expected, cause a BFD session to go down. The BFD multiplier applies to all configured BFD sessions on the interface.

Task ID

Task ID

Operations

hsrp

read, write

Examples

The following example shows how to configure a BFD multiplier with multiplier value of 10:


RP/0/RP0/CPU0:router(config)# router hsrp
RP/0/RP0/CPU0:router(config-hsrp)# interface gig 0/1/1/0
RP/0/RP0/CPU0:router(config-hsrp-if)# hsrp bfd multiplier 10

hsrp delay

To configure the activation delay for the Hot Standby Router Protocol (HSRP), use the hsrp delay command in HSRP interface configuration mode. To delete the activation delay, use the no form of this command.

hsrp delay minimum value reload value

no hsrp delay

Syntax Description

minimum value

Sets the minimum delay in seconds for every interface up event. Range is 0 to 10000.

reload value

Sets the reload delay in seconds for first interface up event. Range is 0 to 10000.

Command Default

minimum value : 1

reload value : 5

Command Modes

HSRP interface configuration

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

The hsrp delay command delays the start of the HSRP finite state machine (FSM) on an interface up event to ensure that the interface is ready to pass traffic. This ensures that there are no mistaken state changes due to loss of hello packets. The minimum delay is applied on all interface up events and the reload delay is applied on the first interface event.

The values of zero must be explicitly configured to turn this feature off.

Task ID

Task ID

Operations

hsrp

read, write

Examples

The following example shows how to configure a minimum delay of 10 seconds with a reload delay of 100 seconds:



Router(config)# router hsrp
Router(config-hsrp)# interface tenGigE 0/RP0/CPU0/0
Router(config-hsrp-if)# hsrp delay minimum 10 reload 100

hsrp ipv4

To activate the Hot Standby Router Protocol (HSRP), use the hsrp ipv4 command in HSRP interface configuration mode. To disable HSRP, use the no form of this command.

hsrp ipv4 [ ip-address [secondary] ]

no hsrp group-number ipv4 [ ip-address [secondary] ]

Syntax Description

group-number

(Optional) Group number on the interface for which HSRP is being activated. Range is 0 to 255. Default is 0.

ip-address

(Optional) IP address of the Hot Standby router interface.

secondary

(Optional) Indicates that the IP address is a secondary Hot Standby router interface. Useful on interfaces with primary and secondary addresses; you can configure primary and secondary HSRP addresses.

Command Default

group-number : 0

HSRP is disabled by default.

Command Modes

HSRP interface configuration

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

The hsrp ipv4 command activates HSRP on the configured interface. If an IP address is specified, that address is used as the designated address for the Hot Standby group. If no IP address is specified, the virtual address is learned from the active router. For HSRP to elect a designated router, at least one router in the Hot Standby group must have been configured with, or must have learned, the designated address. Configuring the designated address on the active router always overrides a designated address that is currently in use.

When the hsrp ipv4 command is enabled on an interface, the handling of proxy Address Resolution Protocol (ARP) requests is changed (unless proxy ARP was disabled). If the Hot Standby state group has been configured with or has learned the designated address, the proxy ARP requests are answered using the MAC address of the Hot Standby group. Otherwise, proxy ARP responses are suppressed.

Configuring secondary Hot Standby router IP addresses is necessary when the interface has secondary IP addresses configured and redundancy must be provided for the networks of these addresses also.

A primary address must be configured before a secondary address. Likewise, a secondary address must be unconfigured before unconfiguring a primary address. All IP addresses can be unconfigured using the no hsrp ipv4 command.

Task ID

Task ID

Operations

hsrp

read, write

Examples

The following example shows how to activate HSRP for group 1 on tengige interface 0/2/0/1. The IP address used by the Hot Standby group is learned using HSRP.



Router(config)# router hsrp
Routerrouter(config-hsrp)# interface tenGigE 0/2/0/1
Router(config-hsrp-if)# hsrp 1 ipv4

hsrp redirects

To configure Internet Control Message Protocol (ICMP) redirect messages to be sent when the Hot Standby Router Protocol (HSRP) is configured on an interface, use the hsrp redirects command in HSRP interface configuration mode. To revert to the default, which is that ICMP messages are enabled, use the no form of this command.

hsrp redirects disable

no hsrp redirects disable

Syntax Description

disable

Disables the filtering of ICMP redirect messages on interfaces configured with HSRP.

Command Default

HSRP ICMP redirects are enabled by default.

Command Modes

HSRP interface configuration

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

The hsrp redirects command can be configured on a per-interface basis. When HSRP is first configured on an interface, the setting for that interface inherits the global value. With the hsrp redirects command is enabled, ICMP redirects messages are filtered by replacing the real IP address in the next-hop address of the redirect packet with a virtual IP address if it is known to HSRP.

Task ID

Task ID

Operations

hsrp

read, write

Examples

The following example shows how to allow HSRP to filter redirect messages on tengige interface 0/2/0/1:



Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/2/0/1 
Router(config-hsrp-if)# hsrp 1 ipv4 192.168.18.1 
Router(config-hsrp-if)# hsrp redirects disable

interface (HSRP)

To enable Hot Standby Router Protocol (HSRP) interface configuration command mode, use the interface command in router configuration mode. To terminate interface mode, use the no form of this command.

interface type interface-path-id

no interface type interface-path-id

Syntax Description

type

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Physical interface or virtual interface.

Note

 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

Command Default

HSRP is disabled.

Command Modes

Router HSRP configuration

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

All the commands used to configure HSRP are used in HSRP interface configuration mode.

Task ID

Task ID

Operations

hsrp

read, write

Examples

The following example show how to enable HSRP interface configuration mode on tengige 0/2/0/1:




Router(config)# router hsrp
Router(config-hsrp)# interface tenGigE 0/2/0/1
Router(config-hsrp-if)#

preempt (hsrp)

To configure Hot Standby Router Protocol (HSRP) preemption and preemption delay, use the hsrp preempt command in HSRP interface configuration mode. To restore the default values, use the no form of this command.

hsrp [group-number] preempt [ delay seconds ]

no hsrp [group-number] preempt [ delay seconds ]

Syntax Description

group-number

(Optional) Group number on the interface to which the other arguments in this command apply. Default is 0.

delay seconds

(Optional) Time in seconds. The seconds argument causes the local router to postpone taking over the active role for the specified preempt delay seconds value. Range is 0 to 3600 seconds (1 hour). Default is 0 seconds (no delay).

Command Default

group-number : 0

seconds : 0 seconds (if the router wants to preempt, it does immediately)

Command Modes

HSRP interface configuration

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

When the hsrp preempt command is configured, the local router should attempt to assume control as the active router if it has a hot standby priority higher than the current active router. If the hsrp preempt command is not configured, the local router assumes control as the active router only if no other router is currently in the active state.

When a router first comes up, it does not have a complete routing table. If HSRP is configured to preempt, the local HSRP group may become the active router, yet it is unable to provide adequate routing services. This problem can be solved by configuring a delay before the preempting router actually preempts the currently active router.

The preempt delay seconds value does not apply if there is no router currently in the active state. In this case, the local router becomes active after the appropriate timeouts (see the hsrp timers command), regardless of the preempt delay seconds value.

Task ID

Task ID

Operations

hsrp

read, write

Examples

In the following example, the router waits for 300 seconds (5 minutes) after having determined that it should preempt before attempting to preempt the active router. The router might become the active router in a shorter span of time despite the configured delay if no active router is present. Only preempting the active router is delayed.

RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# router hsrpi 
RP/0/RSP0/CPU0:router(config-hsrp)# interface tenGigE 0/4/0/4
RP/0/RSP0/CPU0:router(config-hsrp-if)# address-family ipv4
RP/0/RSP0/CPU0:router(config-hsrp-ipv4)# hsrp 1 version 2
RP/0/RSP0/CPU0:router(config-hsrp-gp)# preempt delay 300
RP/0/RSP0/CPU0:router(config-hsrp-gp)#

priority (hsrp)

To configure Hot Standby Router Protocol (HSRP) priority, use the priority command in HSRP group submode. To restore the default values, use the no form of this command.

priority priority

no priority priority

Syntax Description

priority

Priority value that prioritizes a potential Hot Standby router. Range is from 1 to 255. Default is 100.

Command Default

The default priority is 100.

Command Modes

HSRP interface configuration

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

The assigned priority is used to help select the active and standby routers. Assuming that preemption is enabled, the router with the highest priority becomes the designated active router. In case of ties, the interface IP addresses are compared, and the interface with the higher IP address has priority.

The priority of the device can change dynamically if an interface is configured with the hsrp track command and another interface on the device goes down.

If preemption is not enabled, the router may not become active even though it might have a higher priority than other HSRP routers.

Task ID

Task ID

Operations

hsrp

read, write

Examples

In this example, the router has a priority of 120:

Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tengige 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 1 version 2
Router(config-hsrp-gp)# priority 120
Router(config-hsrp-gp)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

router hsrp

To enable the Hot Standby Router Protocol (HSRP), use the router hsrp command in XR Config mode. To disable HSRP, use the no form of this command.

router hsrp

no router hsrp

Syntax Description

This command has no keywords or arguments.

Command Default

HSRP is disabled.

Command Modes

XR Config mode

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

HSRP configuration commands must be configured in the HSRP interface configuration mode.

Task ID

Task ID

Operations

hsrp

read, write

Examples

The following example shows how to configure an HSRP redundancy process that contains a virtual router group 1 on tengige 0/2/0/1:


Router(config)# router hsrp
Router(config-hsrp)# interface tenGigE 0/2/0/1
Router(config-hsrp-if)# hsrp 1 priority 254

session name

To configure an HSRP session name, use the session name command in the HSRP group submode. To deconfigure an HSRP session name, use the no form of this command.

name name

Syntax Description

name

MGO session name

Command Default

None

Command Modes

HSRP Group Submode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read

Examples

This example shows how to configure an HSRP session name.

Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 1 version 2
Router(config-hsrp-gp)# name s1
Router(config-hsrp-gp)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

show hsrp

To display Hot Standby Router Protocol (HSRP) information, use the show hsrp command in XR EXEC mode mode.

show hsrp [ interface interface-type interface-path-id ] [ group-number ] [ brief | detail ]

Syntax Description

interfaceinterface-type

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Physical interface or virtual interface.

Note

 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

group-number

(Optional) Group number on the interface for which output is displayed.

brief

(Optional) A single line of output summarizes each standby group. The brief keyword is the default if detail is not specified.

detail

(Optional) This keyword has the same effect as not specifying brief ; more output is provided.

(Optional) After this vertical bar (|), specify one of these output modifiers and a keyword from the output:

  • begin —Begins the output from the word that you specify.

  • exclude —Excludes lines that match the word that you specify.

  • include —Includes lines that match the word that you specify.

Command Default

By default, a single line of output summarizing each standby group is displayed.

Command Modes

XR EXEC mode

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

Use the show hsrp command to display HSRP information.

If you want to specify a value for the group-number argument, you must also specify an interface type and number .

Task ID

Task ID

Operations

hsrp

read

Examples

This is sample output from the show hsrp detail command:


Router# show hsrp detail

tengige 0/4/0/0 - Group 1
  Local state is Active, priority 100
  Hellotime 3 sec holdtime 10 sec
  Next hello sent in 0.539
  Minimum delay 1 sec, reload delay 5 sec
BFD enabled: state none, interval 15 ms multiplier 3 
  Hot standby IP address is 4.0.0.100 configured
  Active router is local
  Standby router is unknown expired
  Standby virtual mac address is 0000.0c07.ac01
  2 state changes, last state change 00:05:20

This table describes the significant fields shown in the display.

Table 1. show hsrp Command Field Descriptions

Field

Description

tengige E0/2/0/4

Interface type and number and Hot Standby group number for the interface.

Local state is

State of local networking device; can be one of the following:

  • Active—Current Hot Standby router.

  • Standby—Router next in line to be the Hot Standby router.

  • Speak—Router is sending packets to claim the active or standby role.

  • Listen—Router is neither active nor standby, but if no messages are received from the active or standby router, it will start to “speak.”

  • Learn—Router is neither active nor standby, nor does it have enough information to attempt to claim the active or standby roles.

  • Init—Router is not yet ready to participate in HSRP, possibly because the associated interface is not up.

Hellotime

Current time (in seconds) between sending of hello packets, learned dynamically from the hello packets received from the active Hot Standby router.

holdtime

Current time (in seconds) before other routers declare the active or standby router to be down, learned dynamically from the hello packets received from the active Hot Standby router.

Next hello sent in

Time in which the software will send the next hello packet (in hours:minutes:seconds).

BFD enabled

Displays BFD related information (with multiplier and minimum interval details)

Hot standby IP address is configured

IP address of the current Hot Standby router. The word “configured” indicates that this address is known through the hsrp ip command. Otherwise, the address was learned dynamically through HSRP hello packets from other routers that do have the HSRP IP address configured.

Active router is

Value can be “local” or an IP address. Address of the current active Hot Standby router.

Standby router is

Value can be “local” or an IP address of the standby router (the router that is next in line to be the Hot Standby router).

Standby virtual mac address is

MAC address associated with the standby group address.

state changes

Number of times the router changed the standby state.

last state change

Time (in hours:minutes:seconds) expired since the last state change.

Tracking interface states for

List of interfaces that are being tracked and their corresponding states. Based on the hsrp track command.

Priority decrement

Value by which the standby priority is decremented or incremented when the tracked interface goes down or up, respectively. Default is 10.

show hsrp mgo

To display Hot Standby Router Protocol (HSRP) mgo information across all interfaces, use the show hsrp mgo command in XR EXEC mode.

show hsrp mgo [ brief | session-name ]

Syntax Description

brief

(Optional) Displays information in a brief format.

session-name

(Optional) Display information for a single MGO Session.

Command Default

None

Command Modes

XR EXEC mode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read

Examples

This example shows Hot Standby Router Protocol (HSRP) mgo information for interface HSRP3.



Router# show hsrp mgo HSRP3

HSRP3
  Primary group Bundle-Ether1.1 IPv4 group 1
  State is Active
  Slave groups:
    Interface                 Grp
    Bundle-Ether1.2             2
    Bundle-Ether1.3             3
    Bundle-Ether1.4             4
    Bundle-Ether1.5             5

This example shows Hot Standby Router Protocol (HSRP) mgo information across all interfaces in a brief format.



Router# show hsrp mgo brief

Name            Interface  	   AF   Grp    State Slaves
HSRP1           Gi0/0/0/1       IPv4   1   Active    100
HSRP2           Te0/1/0/0.1     IPv4   2  Standby     50
HSRP3           BE1             IPv4   1   Active      4
HSRP4           BE1             IPv6  10   Active     11

show hsrp statistics

To display Hot Standby Router Protocol (HSRP) statistics information across all interfaces, use the show hsrp statistics command in XR EXEC mode.

show hsrp [ interface-type interface-path-id | group-number ] statistics

Syntax Description

interface-type interface-path-id

Physical interface or virtual interface.

Note

 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

group-number

(Optional) Group number of the interface.

Command Modes

XR EXEC mode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read

Examples

This sample output is from the show hsrp statistics command:



 Router# show hsrp statistics
Protocol:
  Transitions to Active                 2
  Transitions to Standby                2
  Transitions to Speak                  0
  Transitions to Listen                 2
  Transitions to Learn                  0
  Transitions to Init                   0

Packets Sent:                          12
  Hello:                                7
  Resign:                               0
  Coup:                                 2
  Adver:                                3
 
Valid Packets Received:                 13
  Hello:                                8
  Resign:                               2
  Coup:                                 0
  Adver:                                3

Invalid packets received:               0
  Too long:                             0
  Too short:                            0
  Mismatching/unsupported versions:     0
  Invalid opcode:                       0
  Unknown group:                        0
  Inoperational group:                  0
  Conflicting Source IP:                0
  Failed Authentication:                2
  Invalid Hello Time:                   0
  Mismatching Virtual IP:               0

show hsrp summary

To display Hot Standby Router Protocol (HSRP) summary information across all interfaces, use the show hsrp summary command in XR EXEC mode mode.

show hsrp summary

Syntax Description

This command has no keywords or arguments.

Command Default

None

Command Modes

XR EXEC mode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read

Examples

This sample output is from the show hsrp summary command:



Router# show hsrp summary
																Groups               VIPs
State 	Sessions Slaves Total     Up  Down  Total
-----   ---------------------   -----------------
ALL          60    900    960    860  2020   2880  

ACTIVE       10    190    200    200   300    500
STANDBY      15    235    250    250   600    850   
SPEAK        10    190    200    200   400    600
LISTEN       10    190    200    200   400    600
LEARN         5      5     10     10    20     30
INIT         10     90    100      0   300    300

48   HSRP IPv4 interfaces    (43   up, 5   down)
5   Tracked IPv4 interfaces (4    up, 1    down)
5    BFD sessions       (3    up, 2    down)

hsrp slave follow

To instruct the subordinate group to inherit its state from a specified group, use the hsrp slave follow command in HSRP slave submode.

follow mgo-session-name

Syntax Description

mgo-session-name

Name of the MGO session from which the subordinate group will inherit the state.

Command Default

None

Command Modes

HSRP Slave Submode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read, write

Examples

This example shows how to instruct the subordinate group to inherit its state from a specified group.


Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp slave 
Router(config-hsrp-slave)# follow m1

subordinate primary virtual IPv4 address

To configure the primary virtual IPv4 address for the subordinate group, use the subordinate primary virtual IPv4 address command in the HSRP slave submode.

address ip-address

Syntax Description

ip-address

IP address of the Hot Standby router interface.

Command Default

None

Command Modes

HSRP Slave Submode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read, write

Examples

This example shows how to configure the primary virtual IPv4 address for the subordinate group.



Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp slave 
Router(config-hsrp-slave)# address 10.2.1.4

subordinate secondary virtual IPv4 address

To configure the secondary virtual IPv4 address for the subordinate group, use the subordinate secondary virtual IPv4 address command in the HSRP slave submode.

address ip-address secondary

Syntax Description

ip-address

IP address of the Hot Standby router interface.

secondary

Sets the secondary hot standby IP address.

Command Default

None

Command Modes

HSRP Slave Submode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID Operation
hsrp

read, write

Examples

This example shows how to configure the secondary virtual IPv4 address for the subordinate group.



Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tengige 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp slave 
Router(config-hsrp-slave)# address 10.2.1.4 secondary

timers (hsrp)

To configure the time between hello packets and the time before other routers declare the active Hot Standby or standby router to be down, use the hsrp timers command in HSRP group submode. To restore the timers to their default values, use the no form of this command.

timers { hello-seconds | msec hello-milliseconds } { hold-seconds | msec hold-milliseconds }

no timers

Syntax Description

hello-seconds

Hello interval in seconds. Range is from 1 to 255. Default is 3.

msec hello-milliseconds

Hello interval in milliseconds. Range is from 100 to 3000.

hold-seconds

Time in seconds before the active or standby router is declared to be down. Range is from 1 to 255. Default is 10.

msec hold-milliseconds

Time in milliseconds before the active or standby router is declared to be down. Range is from 100 to 3000.

Command Default

The default hello-seconds is 3. (If the msec keyword is specified, there is no default value.)

The default hold-seconds is 10. (If the msec keyword is specified, there is no default value.)

Command Modes

HSRP Group Submode

Command History

Release Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

Nonactive routers learn timer values from the active router, unless millisecond timer values are being used. If millisecond timer values are being used, all routers must be configured with the millisecond timer values. This rule applies if either the hello time or the hold time is specified in milliseconds.

The timers configured on the active router always override any other timer settings. All routers in a Hot Standby group should use the same timer values. Normally, the hold time is greater than or equal to three times the hello time (holdtime > 3 * hellotime).

You must specify either the hello-seconds argument or the msec keyword and hello-milliseconds argument, depending on whether you want the hello time in seconds or milliseconds. You must also specify either the hold-seconds argument or msec keyword and hold-milliseconds argument, depending on whether you want the hold time in seconds or milliseconds.

Task ID

Task ID

Operations

hsrp

read, write

Examples

This example shows how to set, for group number 1 on Ten Gigabit Ethernet interface 0/2/0/1, the time between hello packets to 5 seconds and the time after which a router is considered to be down to 15 seconds. The configured timer values are used only if the router is active (or before they have been learned).



Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tengige 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 1
Router(config-hsrp-gp)# timers 5 15
Router(config-hsrp-gp)#

This example shows how to set, for group number 1 on Ten Gigabit Ethernet interface 0/2/0/1, the time between hello packets to 200 milliseconds and the time after which a router is considered to be down to 1000 milliseconds. The configured timer values are always used because milliseconds have been specified.



Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 1 version 2
Router(config-hsrp-gp)# timers msec 200 msec 1000
Router(config-hsrp-gp)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

track (hsrp)

To configure an interface so that the Hot Standby priority changes on the basis of the availability of other interfaces, use the hsrp track command in HSRP group submode. To remove the tracking, use the no form of this command.

track type interface-path-id [priority-decrement]

no track type interface-path-id [priority-decrement]

Syntax Description

type

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Physical interface or virtual interface.

Note

 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark (?) online help function.

priority-decrement

(Optional) Amount by which the Hot Standby priority for the router is decremented (or incremented) when the interface goes down (or comes back up). Range is 1 to 255.

Command Default

The default priority-decrement is 10.

Command Modes

HSRP Group Submode

Command History

Release

Modification

Release 7.1.1

This command was introduced. This command replaced the hsrp track command.

Usage Guidelines

The hsrp track command ties the Hot Standby priority of the router to the availability of its interfaces. It is useful for tracking interfaces that are not configured for the Hot Standby Router Protocol (HSRP). Only IP interfaces are tracked. A tracked interface is up if IP on that interface is up. Otherwise, the tracked interface is down.

When a tracked interface goes down, the Hot Standby priority decreases by 10. If an interface is not tracked, its state changes do not affect the Hot Standby priority. For each group configured for Hot Standby, you can configure a separate list of interfaces to be tracked.

The optional priority-decrement argument specifies by how much to decrement the Hot Standby priority when a tracked interface goes down. When the tracked interface comes back up, the priority is incremented by the same amount.

When multiple tracked interfaces are down and priority-decrement values have been configured, these configured priority decrements are cumulative. If tracked interfaces are down, but none of them were configured with priority decrements, the default decrement is 10 and it is cumulative.

The hsrp preempt command must be used in conjunction with this command on all routers in the group whenever the best available router should be used to forward packets. If the hsrp preempt command is not used, then the active router stays active, regardless of the current priorities of the other HSRP routers.

Task ID

Task ID

Operations

hsrp

read, write

Examples

This example shows how to configure an interface so that the Hot Standby priority changes on the basis of the availability of other interfaces.

Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 1 version 2
Router(config-hsrp-gp)# track tenGigE 0/4/0/4 2 
Router(config-hsrp-gp)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.

track(object)

To enable tracking of a named object with the specified decrement, use the track (object) command in HSRP group submode. To remove the tracking, use the no form of this command.

track object name [priority-decrement]

no track object name [priority-decrement]

Syntax Description

object name

Object tracking. Name of the object to be tracked.

priority-decrement

(Optional) Amount by which the Hot Standby priority for the router is decremented (or incremented) when the interface goes down (or comes back up). Range is 1 to 255.

Command Default

The default priority-decrement is 10.

Command Modes

HSRP Group Submode

Command History

Release

Modification

Release 7.1.1

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

hsrp

read, write

Examples

This example shows how to configure object tracking under the HSRP group submode.

Router# configure 
Router(config)# router hsrp 
Router(config-hsrp)# interface tenGigE 0/4/0/4
Router(config-hsrp-if)# address-family ipv4
Router(config-hsrp-ipv4)# hsrp 1 version 2
Router(config-hsrp-gp)# track object t1 2
Router(config-hsrp-gp)#


Note


  • The version keyword is available only if IPv4 address-family is selected. By default, version is set to 2 for IPv6 address families.

  • The HSRP version 2 extended group range must be restricted to 0-255, even though the configuration up to 0-4095 is accepted.



Note


Starting with IOS XR Release 7.4.1, the HSRP version 2 extended group range configurable in the router is restricted to 0-255.