The objective of this lab is to configure the Hot Standby Router Protocol (HSRP) on two routers that are connecting a host device to the internet.
Hot Standby Router Protocol (HSRP) is a Cisco proprietary redundancy protocol that provides high availability service to a host device by allowing two or more routers to serve as a default gateway for a particular host device. This enables an automatic failover to a standby router in the event of the primary router’s failure.
Network Topology
The network topology for this lab is shown below. As you can see, it consists of two routers (R1 and R2) that have a connection to the internet. These two routers also have connections to the host device through the switch and, therefore, will be configured as HSRP group.
Lab Objective
The objective of this lab is to configure static routes on each router as follows:
- Configure the IP address of the interfaces of the routers as labeled in the network topology. Also, configure the loopback interfaces as labeled in the network topology.
- Configure the default route to 192.168.0.1 on both R1 and R2.
- Test the default route configuration by pinging 8.8.8.8, which is an address over the internet.
- Configure HSRP Group 1 on R1 and R2. The virtual IP address should be 172.16.0.254.
- Configure preemption on R1 and R2.
- Configure a priority value of 150 on R2.
- Configure NAT (PAT) on R1 and R2 to allow the PC (and devices within the 172.16.0.0/24 network) to access resources on the internet.
- Test your configuration.
Lab Solution
Before going through this solution, make sure you have tried the lab yourself.
on R1,
[Step1]: Configure R1 to connect to the Internet
=====================================
R1(config)#interface ethernet0/0
R1(config-if)#ip address 192.168.0.12 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.1
R1#ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 23/23/23 ms
=====================================
[Step2]: Configure R2 to connect to the Internet
=====================================
R2(config)#interface ethernet0/0
R2(config-if)#ip address 192.168.0.21 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.0.1
R2#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms
=====================================
[Step3]: Configure HSRP and Preemption (Set to Standby)
=====================================
R1(config)#interface ethernet0/1
R1(config-if)#ip address 172.16.0.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#standby 1 ip 172.16.0.254
R1(config-if)#standby 1 preempt
=====================================
[Step4]: Configure HSRP, Priority and Preemption (Set to Active)
=====================================
R2(config)#interface ethernet0/1
R2(config-if)#ip address 172.16.0.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#standby 1 ip 172.16.0.254
R2(config-if)#standby 1 priority 150 <-- The router with the second-highest priority value becomes the standby router. The priority value can range from 0 to 255, with 100 as the default value.
R2(config-if)#standby 1 preempt
=====================================
[Step5]: To view the HSRP information on R1
=====================================
R1#show standby
Ethernet0/1 - Group 1
State is Standby <-- R1 is Standy
4 state changes, last state change 00:02:48
Virtual IP address is 172.16.0.254 <-- IP Address Virtual Router
Active virtual MAC address is 0000.0c07.ac01
Local virtual MAC address is 0000.0c07.ac01 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 2.448 secs
Preemption enabled <-- HSRP preemption is a feature that enables a standby router with a higher priority to become the active router in an HSRP group. By default, when the active router goes down, the standby router with the highest priority takes over as the active router.
Active router is 172.16.0.2, priority 150 (expires in 9.072 sec)
Standby router is local
Priority 100 (default 100) <-- 100 as the default priority value
Group name is "hsrp-Et0/1-1" (default)
=====================================
[Step6]: To view the HSRP information on R2
=====================================
R2#show standby
Ethernet0/1 - Group 1
State is Active <-- R2 is Active
2 state changes, last state change 00:03:25
Virtual IP address is 172.16.0.254 <-- IP Address Virtual Router
Active virtual MAC address is 0000.0c07.ac01
Local virtual MAC address is 0000.0c07.ac01 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.736 secs
Preemption enabled <-- HSRP preemption is a feature that enables a standby router with a higher priority to become the active router in an HSRP group. By default, when the active router goes down, the standby router with the highest priority takes over as the active router.
Active router is local
Standby router is 172.16.0.1, priority 100 (expires in 9.136 sec)
Priority 150 (configured 150) <-- Set the priority value to 150 to make R2 become Active.
Group name is "hsrp-Et0/1-1" (default)
=====================================
[Step7]: Configure PAT on R1 to allow the Host PC to access the Internet.
=====================================
R1(config)#access-list 1 permit 172.16.0.0 /24
R1(config)#ip nat inside source list 1 interface ethernet0/0 overload
R1(config)#interface ethernet0/0
R1(config-if)#ip nat outside
R1(config-if)#exit
R1(config)#interface ethernet0/1
R1(config-if)#ip nat inside
R1(config-if)#exit
=====================================
[Step8]: Configure PAT on R2 to allow the Host PC to access the Internet.
=====================================
R2(config)#access-list 1 permit 172.16.0.0 /24
R2(config)#ip nat inside source list 1 interface ethernet0/0 overload
R2(config)#interface ethernet0/0
R2(config-if)#ip nat outside
R2(config-if)#exit
R2(config)#interface ether0/1
R2(config-if)#ip nat inside
R2(config-if)#exit
=====================================
on PC,
[Step9]: Disable the routing table, configure the IP address, and set the virtual gateway on the PC
=====================================
PC(config)#no ip routing
PC(config)#interface ethernet0/0
PC(config-if)#ip address 172.16.0.100 255.255.255.0
PC(config-if)#no shutdown
PC(config-if)#exit
PC(config)#ip default-gateway 172.16.0.254 <-- IP Address Virtual Router PC(config)#exit ===================================== >>>>> Testing <<<<<
[Step 10]: Host PC ping to 1.1.1.1 (150 times)
=====================================
PC#ping 1.1.1.1 repeat 150
Type escape sequence to abort.
Sending 150, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!
Success rate is 100 percent (150/150), round-trip min/avg/max = 2/2/4 ms
=====================================
If you need any detail about the above lab, here is a separate post where we explained it in detail; How to configure HSRP on Cisco Router
Reference: https://github.com/misterkrittin/CCNA-Labs
I am a passionate Networking Associate specializing in Telecommunications.
With a degree in Electronic engineering, I possess a strong understanding of electronic systems and the intricacies of telecommunications networks. I gained practical experience and valuable insights working for a prominent telecommunications company.
Additionally, I hold certifications in networking, which have solidified my expertise in network architecture, protocols, and optimization.
Through my writing skills, I aim to provide accurate and valuable knowledge in the networking field.
Connect with me on social media using the links below for more insights.
You can contact me using [email protected] or connect with me using any of the social media account linked below