Configuring Basic HSRP Functionality
Problem
You want a backup router to take over the MAC and IP addresses of a primary router if the primary fails.
Solution
Figure 22.1 represents a typical network design for use with
HSRP on an Ethernet type LAN segment (including Fast Ethernet, Gigabit
Ethernet, and 10 Gigabit Ethernet). There are two routers, called
Router1 and Router2. They have IP addresses 172.22.1.3 and 172.22.1.2, respectively. When both routers
are available, we want Router1 to handle all of the traffic, using the
virtual IP address 172.22.1.1.
Configure the first router as follows:
Router1#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router1(config)#interfaceRouter1(config-if)#FastEthernet 0/1ip addressRouter1(config-if)#172.22.1.3 255.255.255.0standby 1 ipRouter1(config-if)#172.22.1.1standby 1 priorityRouter1(config-if)#120exitRouter1(config)#endRouter1#
The second router’s configuration is similar, except that the interface has a different real IP address and a lower HSRP priority level:
Router2#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router2(config)#interfaceRouter2(config-if)#FastEthernet 1/0ip addressRouter2(config-if)#172.22.1.2 255.255.255.0standby 1 ipRouter2(config-if)#172.22.1.1standby 1 priorityRouter2(config-if)#110exitRouter2(config)#endRouter2#
Discussion
In this example, we use the first address of the subnet,
172.22.1.1, as the virtual HSRP address, and consequently ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access