Configure Hot Standby Routing Protocol on Cisco Routers
|
|
|
|
Introduction
This document explains how to configure Hot Standby Routing protocol
(HSRP) and Multiple HSRP (MHSRP) on a Cisco router for redundancy and load
balancing.
Back to Top
Requirements
To perform the steps described in this document, you need to have these
items:
Back to Top
HSRP and MHSRP Overview
HSRP provides high network availability by providing redundancy for IP
traffic from hosts on networks. HSRP routes IP traffic without relying on the
availability of any single router. It enables a set of router interfaces to
work together, to present the appearance of a single virtual router or default
gateway to the hosts on a LAN. In a group of router interfaces, the active
router is the router of choice for routing packets; the standby router is the
router that takes over the routing duties when an active router fails. When
HSRP is configured on a network segment, it provides a virtual MAC address and
an IP address that is shared among router interfaces in a group of router
interfaces running HSRP. The router selected by the protocol to be the active
router receives and routes packets destined for the group's MAC address. HSRP
detects when the designated active router fails, and a selected standby router
assumes control of the group's MAC and IP addresses. A new standby router is
also selected at that time. Devices running HSRP send and receive multicast
UDP-based hello packets to detect router failure and to designate active and
standby routers.
Multiple HSRP (MHSRP) is an extension of HSRP that allows load sharing
between two or more HSRP groups in addition to provide redundancy. In a simple
MHSRP configuration, two routers are configured to be part of two HSRP groups.
However, the first router is the active router for first group and standby for
the second group whereas, the second router is the active router for second
group and standby for the first group. This is achieved by assigning a priority
to each router for each group. During normal operation, the two routers share
the IP traffic load. When either router becomes unavailable, the other router
becomes active and assumes the packet-transfer functions of the router that is
unavailable.
In this document two routers are connected to the inside network
through interface fastEthernet0/0 via a switch. The fastEthernet0/0 interfaces
of the routers are assigned IP addresses 192.168.10.1 and 192.168.10.2
respectively. The default gateway for the hosts in the inside network is the
virtual IP address of HSRP/MHSRP and not the assigned IP addresses of the
fastEthernet0/0 interface. For MHSRP, the first router is active router for
group 1 and the second router is the active router for group 2.
Configure HSRP
Follow these steps to configure HSRP on a router:
-
Connect to the console of the first router, refer
Create a
HyperTerminal Connection.
-
Get into the interface configuration mode and configure the IP
address for the interface.
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet0/0
Router(config-if)#ip address 192.168.10.1 255.255.255.0
-
Enter the command standby ip followed by a virtual
IP address to activate HSRP on the configured interface. Enter no
shut command to bring up the interface.
Router(config-if)#standby ip 192.168.10.3
Router(config-if)#no shut
-
Exit the configuration mode and return to exec mode. Save this
configuration.
Router(config-if)#end
Router#copy running-config startup-config
Configure the second router using the same steps and change the IP
addresses to reflect the second router’s IP addresses but use the same virtual
IP address in the standby ip command.
Configure MHSRP
Follow these steps to configure MHSRP on the first
router:
-
Connect to the console of the first router, refer
Create a
HyperTerminal Connection.
-
Get into the interface configuration mode and configure the IP
address for the interface.
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet0/0
Router(config-if)#ip address 192.168.10.1 255.255.255.0
-
Enter the command standby ip with a group id
followed by a virtual IP address to activate MHSRP on the configured interface.
Also, assign a priority of a value above 100 to make the router active for this
group using the command standby priority. Enter the
standby preempt command so that the router becomes active for
this group if it gets reloaded.
Router(config-if)#standby 1 ip 192.168.10.3
Router(config-if)#standby 1 priority 110
Router(config-if)#standby 1 preempt
-
To make this router standby for the other group enter the command
standby ip with a different group id followed by a virtual IP
address of the other group.
Router(config-if)#standby 2 ip 192.168.10.4
Router(config-if)#standby 2 preempt
-
Enter no shut command to bring up the interface.
Exit the configuration mode and return to exec mode. Save this
configuration.
Router(config-if)#no shut
Router(config-if)#end
Router#copy running-config startup-config
Follow these steps to configure MHSRP on the second
router:
-
Connect to the console of the second router, refer
Create a
HyperTerminal Connection
-
Get into the interface configuration mode and configure the IP
address for the interface.
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet0/0
Router(config-if)#ip address 192.168.10.2 255.255.255.0
-
Enter the command standby ip with a group id
followed by a virtual IP address to activate MHSRP on the configured interface.
Also, assign a priority of a value above 100 to make the router active for this
group using the command standby priority. Enter the
standby preempt command so that, the router becomes active for
this group if it gets reloaded.
Router(config-if)#standby 2 ip 192.168.10.4
Router(config-if)#standby 2 priority 110
Router(config-if)#standby 2 preempt
-
To make this router standby for the other group, enter the command
standby ip with a different group id followed by a virtual IP
address of the other group.
Router(config-if)#standby 1 ip 192.168.10.3
Router(config-if)#standby 1 preempt
-
Enter no shut command to bring up the interface.
Exit the configuration mode and return to exec mode. Save this
configuration.
Router(config-if)#no shut
Router(config-if)#end
Router#copy running-config startup-config
Back to Top
Next Step
You have now configured HSRP on your router.
To make further changes to your router, refer to the
Router Support
Page.
To configure other devices in your network, refer to the
Configuration
Overview Page.
Back to Top
Troubleshoot the Procedure
This section provides information about common problems that you may
encounter. If this information does not solve your problem, contact the
SMB
Technical Assistance Center (SMB TAC) for assistance.
Problem
|
Cause(s) and Suggested Solution(s)
|
Check if HSRP/MHSRP is working properly.
|
Use the command show standby and check the
output if the virtual IP addresses are in use and the status is shown as
active.
|
Back to Top
Related Information