TechKnowSurge
Cisco CCNA 3.5
VideoNetworkFree

DEMO: HSRP

Hot Standby Router Protocol (HSRP) configuration requires assigning virtual IP addresses to switch virtual interfaces and setting standby group priorities across two Layer 3 switches. This content covers the CLI commands used to deploy HSRP, verify active and standby roles, and enable preemption for automatic failover.

Complete this video to capture a CTF flag worth 1 point.

About this video

HSRP provides first-hop redundancy by presenting a single virtual IP address to end devices while two or more Layer 3 switches share responsibility for that address behind the scenes. Configuration begins on the switch virtual interface for the target VLAN, where the physical interface IP is set independently of the virtual IP, and a standby group is created by assigning that group number along with the shared virtual IP address. The switch assigned the higher priority value becomes the active gateway, responding to traffic destined for the virtual IP, while the lower-priority switch remains in standby and monitors the active device. On the standby switch, the same standby group number and virtual IP are configured, but with a lower priority value than the active switch. Adding the preempt command to the standby switch ensures it will automatically yield the active role back to the preferred switch if that device recovers after an outage. Once both switches are configured, HSRP negotiates roles automatically by cycling through its defined states before declaring one device active, a process that can be observed in real time as ping traffic resumes following a brief connectivity interruption during configuration.

What you'll learn

What's covered

HSRP Configuration Commands

Aligned to

Cisco CCNA
3.5 Describe the purpose, functions, and concepts of first hop redundancy protocols

Key terms

Hot Standby Router Protocol
HSRP
A Cisco proprietary FHRP where a group of routers share a virtual IP address and MAC address, with one active router forwarding traffic while standby routers monitor and take over if the active router fails. HSRP provides transparent default gateway redundancy for end hosts without requiring any client-side configuration.
Default Gateway
The router that a device uses to send traffic to destinations outside its local network.
Redundancy
The duplication of critical components or systems to increase reliability and availability.
Failover
The automatic switching to a redundant system or component when the primary one fails.
Virtual LAN
VLAN
A logical grouping of network devices that behave as if they are on the same network regardless of physical location.
Preempt
An HSRP configuration option that allows a higher-priority router to reclaim the active role automatically when it comes back online after a failure.

Topics

Hsrp First Hop Redundancy Networking Cisco Ios Layer 3 Switching High Availability

Transcript

We're going to go over the commands used to roll out HSRP.

Setting up the topology

To set this up we're going to have to add another Layer 3 switch. What we have right now is this network set up right here. All the items in yellow, and this switch 4 right here, we're going to add now. We're going to let OSPF do its thing on this side of it, so it can automatically change the way it's routing based off of OSPF — we're not concerned with that level. What we need to do is set up on this side virtual IP addresses on these switch virtual interfaces, and then once we do that we also need to connect physically all of these different links here.

There's a lot of programming that happens here, where we need to configure these new interfaces on all of these switches and set it all up. I'm not going to cover all of that, because frankly the CCNA exam isn't going to require you to get really in depth into all of this. So what I'm going to do is jump onto those switch virtual interfaces, go over a few commands, a few show commands, and then end things at that point in time. We're not going to implement any of this long term; this is just going to be for the demo.

Configuring the first Layer 3 switch

I'm on hq-s1. This is the Layer 3 switch that we have been working with. I'm consoled into it because I'm going to lose some connectivity as I go through these commands. Down below I'm pinging the switch on the other side of the network, so we can see when I lose connectivity.

I'm going to start out by going into the global configuration mode, and I'm going to get into interface VLAN 10. In interface VLAN 10 right now, the IP address assigned to it is the virtual IP address that I want to use, so I'm going to have to take that off as being the main IP address. But before I do that, it's going to complain that I have the secondary set and I need to take the secondary off first. So I'm going to take the secondary IP address off. This is where I lose SSH connectivity, because that's the IP address I was SSHed into.

The next thing that I'm going to do is remove the IP address that I want to use as my virtual IP address. I'm going to give it the new IP address, and I chose to do .2. I noticed that when I did the last command it lost connectivity across the network, so I'm going to give it a new IP address. I enter the new IP address in, so now that's .2. I can put the secondary back on so I'd be able to SSH into it again. So now I've got that set.

Now what I'm going to do is create the standby group. I'm going to have the standby group of 10.1.10.1, so I'm going to copy that and paste it into here so it can become the standby group. I'll enter that in, and even though it's a standby, this is going to become the active shortly. It's going through those different states; it doesn't want to step on any toes, just in case there's another device out there that's already responding to this. Once it determines that there isn't, it's going to start pinging and we're going to get connectivity — and there it goes. It's gone through all the states and it is now active.

I also chose this group, so it's group 10. It doesn't really matter what group this is; I chose 10 because it's part of VLAN 10, so that's why I put that in there.

Next I'm going to set the priority. I'm going to set the priority to 120, and that makes this preferred as being the active. So now that is set, and I've got all the commands set up on this Layer 3 switch 1.

Configuring the other side

Now I have to configure the other side of this. I've set up hqs4, so now I'm on the other side on switch four, and what I'm going to do is get into the global configuration mode of that. I need to get into the interface, so let's get into interface for VLAN 10. I need to give it an IP address that needs to be different than the other one, so I'm going to choose .3 on that.

Then I say that this is also standby group 10 with the IP address of 10.1.10.1, so now that's going to be the virtual IP address. I want the priority of this to be less than the other one's, so I'm going to choose 80 on this one — the default is 100, so this is less than the default. I get that entered in, and then I also want this to relinquish control if the other one does come back up, so that's this preempt command. I'll put the preempt command in there, and then we are all set.

So now this virtual IP is being responded to by the active one, and then what I could do is unplug that real fast and then make sure that this fails over to the standby.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →