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 learned,
the designated address. Configuring the designated address on the active router always overrides a designated address that
is currently in use.
Configuration Steps
-
Enable HSRP interface configuration mode on a specific interface.
-
Enable HSRP address-family configuration mode on a specific interface.
-
Enable HSRP group submode.
Note
|
The version keyword is available only if IPv4 address-family is selected.
|
-
Activate HSRP on the configured interface.
Note
|
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.
|
Active Router Configuration
Perform the following configuration once you have configured the main bundle interface, Bundle-Ether500
on an active router and added the member links to Bundle-Ether500.
This example provides the HSRP configuration for IPv4 networks on an active router.
/* Enter the interface configuration mode and configure an IPv4 address for the interface. */
Router(config)# interface Bundle-Ether500.1
Router(config-if)# ipv4 address 61.101.1.1/24
Router(config-if)# encapsulation dot1q 1
Router(config-if)# no shut
Router(config-if)# commit
Fri Feb 23 13:49:24.142 IST
Router:Feb 23 13:49:24.285 : ifmgr[402]: %PKT_INFRA-LINK-3-UPDOWN : Interface Bundle-Ether500.1, changed state to Down
Router:Feb 23 13:49:24.711 : ifmgr[402]: %PKT_INFRA-LINK-3-UPDOWN : Interface Bundle-Ether500.1, changed state to Up
Router(config-if)# exit
Router(config)# do show ip int brief
Fri Feb 23 13:50:05.505 IST
Interface IP-Address Status Protocol Vrf-Name
Bundle-Ether500.1 61.101.1.1 Up Up default
Bundle-Ether500.2 unassigned Shutdown Down default
Bundle-Ether500.3 unassigned Shutdown Down default
Bundle-Ether500.4 unassigned Shutdown Down default
Bundle-Ether500.5 unassigned Shutdown Down default
/* Enter the HSRP configuration mode and add the configured interface. */
Router(config)# router hsrp
Router(config-hsrp)# interface Bundle-Ether500.1
/* Configure HSRP for IPv4 */
Router(config-hsrp-if)# address-family ipv4 hsrp version 2
Router(config-hsrp-virtual-router)# address 61.101.1.3
/* CUSTOMIZATION: Set a priority for the virtual Router. */
Router(config-hsrp-virtual-Router)# priority 100
/* CUSTOMIZATION: Configure a preempt delay value that controls the selection of the IP address owner virtual Router. */
Router(config-hsrp-virtual-Router)# preempt delay 30
/* Commit the configuration */
Router(config-hsrp-virtual-Router)# commit
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––-
Standby Router Configuration
Perform the following configuration once you have configured the main bundle interface, Bundle-Ether500
on a standby router and added the member links to Bundle-Ether500.
This example provides the HSRP configuration for IPv4 networks on a standby router.
/* Enter the interface configuration mode and configure an IPv4 address for the interface. */
Router(config)# interface Bundle-Ether500.1
Router(config-if)# ipv4 address 61.101.1.2/24
Router(config-if)# encapsulation dot1q 1
Router(config-if)# no shut
Router(config-if)# commit
Fri Feb 23 13:49:24.142 IST
Router:Feb 23 13:49:24.285 : ifmgr[402]: %PKT_INFRA-LINK-3-UPDOWN : Interface Bundle-Ether500.1, changed state to Down
Router:Feb 23 13:49:24.711 : ifmgr[402]: %PKT_INFRA-LINK-3-UPDOWN : Interface Bundle-Ether500.1, changed state to Up
Router(config-if)# exit
Router(config)# do show ip int brief
Fri Feb 23 13:50:05.505 IST
Interface IP-Address Status Protocol Vrf-Name
Bundle-Ether500.1 61.101.1.2 Up Up default
Bundle-Ether500.2 unassigned Shutdown Down default
Bundle-Ether500.3 unassigned Shutdown Down default
Bundle-Ether500.4 unassigned Shutdown Down default
Bundle-Ether500.5 unassigned Shutdown Down default
/* Enter the HSRP configuration mode and add the configured interface. */
Router(config)# router hsrp
Router(config-hsrp)# interface Bundle-Ether500.1
/* Configure HSRP for IPv4 */
Router(config-hsrp-if)# address-family ipv4 hsrp version 2
Router(config-hsrp-virtual-router)# address 61.101.1.3
/* CUSTOMIZATION: Set a priority for the virtual Router. */
Router(config-hsrp-virtual-Router)# priority 100
/* CUSTOMIZATION: Configure a preempt delay value that controls the selection of the IP address owner virtual Router. */
Router(config-hsrp-virtual-Router)# preempt delay 30
/* Commit the configuration */
Router(config-hsrp-virtual-Router)# commit
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––-
You have successfully configured HSRP for IPv4 networks on an active and standby routers.
Verification
This example verifies the HSRP configuration for IPv4 networks on an active router.
/* Verify the configuration */
Router(config-hsrp-virtual-router)# do show run interface Bundle-Ether500.1
Fri Feb 23 15:04:38.140 IST
interface Bundle-Ether500.1
ipv4 address 61.101.1.1/24
encapsulation dot1q 1
!
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––--
Router(config)# show running-configuration router hsrp
router hsrp
interface Bundle-Ether500.1
address-family ipv4
encapsulation dot1q
hsrp 1 version 2
preempt
priority 100
address 61.101.1.3
!
!
–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––--
Router# show hsrp detail
Fri Feb 16 04:44:48.322 IST
Bundle-Ether500.1 - IPv4 Group 1 (version 1)
Local state is Active, priority 100, may preempt
Hellotime 3000 msec holdtime 10000 msec
Next hello sent in 2.373
Minimum delay 1 sec, reload delay 5 sec
Hot standby IP address is 61.101.1.3 configured
Active router is local
Standby router is 61.101.1.2 expires in 00:00:08
Standby virtual mac address is 0000.0c07.ac01, state is active
15 state changes, last state change 00:01:17
State change history:
Feb 16 04:56:48.724 UTC Listen -> Active Lower priority active received
Feb 16 05:00:29.439 UTC Active -> Init Interface Down update
Feb 17 05:27:13.516 UTC Init -> Listen Delay timer expired
Feb 17 05:27:14.643 UTC Listen -> Active Lower priority active received
Feb 17 05:53:53.500 UTC Active -> Init Interface Down update
Feb 17 05:58:49.641 UTC Init -> Listen Delay timer expired
Feb 17 05:58:51.031 UTC Listen -> Active Lower priority active received
Feb 17 06:25:20.589 UTC Active -> Init Interface Down update
Feb 17 06:31:13.783 UTC Init -> Listen Delay timer expired
Feb 17 06:31:14.954 UTC Listen -> Active Lower priority active received
Last coup sent: Feb 17 06:31:14.954 UTC
Last coup received: Never
You have successfully verified the HSRP configuration for IPv4 networks.