HSRP provides redundancy for your network's default gateway, ensuring continuous connectivity even if a router fails.
By the end of this course, you’ll understand how HSRP works, its roles, and how to configure it effectively in a network.
Answer the question below
HSRP organizes routers into logical units called HSRP groups, identified by a unique group number. These groups work together to share a virtual gateway address that devices on the network can use.
HSRP Group Example
In our example, we’ll group Router R1 and Router R2 into HSRP Group 1.
Figure 1 – HSRP Group Topology
Once you decide which routers belong to the same HSRP group, you assign a Virtual IP Address (VIP) that acts as the gateway address.
Answer the question below
The VIP is the IP address shared by the HSRP group and it serves as the default gateway for devices in the network. End devices use this VIP to communicate with devices outside their subnet.
Assigning the VIP
In our network (192.168.10.0/24), we assign the VIP 192.168.10.3 for HSRP Group 1. Hosts in this network will use 192.168.10.3 as their default gateway.
Figure 2 – HSRP Virtual IP (VIP) Assigned as Default Gateway
Configuration Example
Here’s how to configure the VIP for HSRP Group 1 on R1 and R2:
R1 Configuration:
R1(config)# interface g0/0 R1(config-if)# ip address 192.168.10.1 255.255.255.0 R1(config-if)# standby 1 ip 192.168.10.3
R2 Configuration:
R2(config)# interface g0/0 R2(config-if)# ip address 192.168.10.2 255.255.255.0 R2(config-if)# standby 1 ip 192.168.10.3
Key Notes:
standby initiates HSRP.
1 represents the HSRP group number.
The ip command sets the Virtual IP Address (VIP).
Answer the question below
What address do hosts use as their HSRP default gateway?
In every HSRP group, routers are assigned specific roles to ensure network redundancy and reliability.
Active Router
The Active Router is responsible for managing traffic destined for the Virtual IP Address (VIP).
It:
Responds to ARP requests for the VIP.
Handles all traffic from devices using the VIP as their default gateway.
Standby Router
The Standby Router acts as a backup.
It:
Monitors the Active Router by exchanging Hello packets.
Takes over as the Active Router if the current Active Router fails.
Figure 3 – HSRP Roles: Active and Standby Routers
Assigning Roles
For this course, we will configure:
R1 as the Active Router: R1 will handle the network traffic under normal conditions.
R2 as the Standby Router: R2 will monitor R1 and take over in case of failure.
In the next section, we will explore how to configure these roles effectively.
Answer the question below
Which router handles traffic destined for the VIP?
As you learn about HSRP, a common question might come to mind:
Figure 4 – How Active and Standby are elected ?
This is an excellent question and the answer is straightforward.
The election of Active and Standby routers in HSRP is determined by two key parameters:
Figure 5 – HSRP Election Criteria: Priority and IP Address
1. Priority
The router with the highest priority is elected as the Active Router.
By default, all routers have a priority of 100, but this can be manually adjusted to influence the election.
The priority value ranges from 0 to 255, with 255 being the highest possible priority.
Configuring priority allows you to designate specific routers for the Active and Standby roles
2. Highest IP Address
If two or more routers have the same priority, the router with the highest IP address on the HSRP interface is elected as the Active Router.
This acts as a tiebreaker when priority values are identical.
Configuring Active and Standby Roles
To designate R1 as the Active Router and R2 as the Standby Router, you need to adjust their priority values. This ensures R1 takes the Active role while R2 remains on standby, ready to take over in case of a failure.
Figure 6 – Manual Configuration of Active and Standby Roles in HSRP
R1 Configuration (Active Router)
R1(config)# interface g0/0 R1(config-if)# ip address 192.168.10.1 255.255.255.0 R1(config-if)# standby 1 ip 192.168.10.3 R1(config-if)# standby 1 priority 110
interface g0/0: Specifies the interface to configure.
ip address 192.168.10.1 255.255.255.0: Assigns an IP address and subnet mask to the interface.
standby 1 ip 192.168.10.3: Configures the HSRP group (1) and assigns the Virtual IP (VIP) 192.168.10.3.
standby 1 priority 110: Sets the HSRP priority to 110, ensuring R1 becomes the Active Router.
R2 Configuration (Standby Router)
R2(config)# interface g0/0 R2(config-if)# ip address 192.168.10.2 255.255.255.0 R2(config-if)# standby 1 ip 192.168.10.3 R2(config-if)# standby 1 priority 100
interface g0/0: Specifies the interface to configure.
ip address 192.168.10.2 255.255.255.0: Assigns an IP address and subnet mask to the interface.
standby 1 ip 192.168.10.3: Configures the HSRP group (1) and assigns the Virtual IP (VIP) 192.168.10.3.
standby 1 priority 100: Sets the HSRP priority to 100, ensuring R2 becomes the Standby Router.
Answer the question below
HSRP routers transition through several states to determine their roles within the group, ultimately deciding which router will become the Active Router and which will become the Standby Router.
Figure 7 – HSRP Router State Transitions
In this setup with two routers:
R1 will transition to the Active State, becoming the primary router responsible for forwarding traffic.
R2 will move to the Standby State, ready to take over if R1 becomes unavailable.
Answer the question below
What state does the backup router assume in HSRP?
HSRP has two main versions: HSRPv1 and HSRPv2.
40 % Complete: you’re making great progress
Unlock the rest of this lesson
If you’d like to continue your CCNA journey, create your free account now.
Access all free CCNA lessons
Practice with quizzes and level test
Progress tracking in your dashboard
Made by network engineers - CCNP certified
Create your Free Account1151 learners continued their CCNA journey this month