How to Configure HSRP in Cisco IOS Routers
Transcript of How to Configure HSRP in Cisco IOS Routers
-
8/4/2019 How to Configure HSRP in Cisco IOS Routers
1/6
How to configure HSRP in Cisco IOS RoutersHSRP stands for Hot Standy Routing Protocol which provides Automatic Routerbackup when anactive router in the group fails. HSRP allows building resiliency in the network gateways whereinshould an Active Router fail in a HSRP group, the standby router assumes the role of the activerouter and continue routing packets.
HSRP works by sending multicast "Hello" messages (default: every 3 secs). If the Standby routerdo not receive any Hello packets from the active router for a preset time (default 10secs) then itassumes the active router is down and becomes the active router. Also, if we are tracking aninterface and if the tracked interface is down, the Active Router reduces its priority so a StandbyRouter can assume to role of Primary Router.
A realtime example would be access to a service providers servers at a remote location. Lets saythere are two distinct routes to the same server(s), each through individual routers. The clients onthe internal network segment are configured to send the traffic through a gateway. The gatewaybeing the HSRP Address. Then the Server is accessible through one service provider always(based on the active router). However, in a disaster situation when the active router goes down,the standby router assumes the active router role and continues to serve connection to theremote servers but using the other service provider. This way routing redundancy is provided to a
remote resource.
To setup HSRP on a pair of routers,
Router 1:
From the Interface Configuration Mode add theIP Address of the Interface
hsrp-router1#conf t
hsrp-router1(config)# int fa0/0
hsrp-router1(config-if)# ip address 192.168.0.2 255.255.255.0
Set the Virtual IP Address
Sets the Virtual IP Address for the interface where "1" is the HSRP group and "92.168.0.1" is theVirtual IP for the HSRP group.
hsrp-router1(config-if)# standby 1 ip 192.168.0.1
http://www.itsyourip.com/cisco/how-to-configure-hsrp-in-cisco-ios-routers/http://www.itsyourip.com/cisco/how-to-configure-hsrp-in-cisco-ios-routers/http://www.itsyourip.com/cisco/how-to-configure-hsrp-in-cisco-ios-routers/http://www.itsyourip.com/cisco/how-to-configure-hsrp-in-cisco-ios-routers/http://www.itsyourip.com/cisco/how-to-configure-hsrp-in-cisco-ios-routers/http://www.itsyourip.com/cisco/how-to-configure-hsrp-in-cisco-ios-routers/http://www.itsyourip.com/cisco/how-to-configure-hsrp-in-cisco-ios-routers/http://www.itsyourip.com/cisco/how-to-configure-hsrp-in-cisco-ios-routers/ -
8/4/2019 How to Configure HSRP in Cisco IOS Routers
2/6
Enable Preempt
This is required to make the router from being a Standby Router to an Active Router when it findsthe Active Router is down or if it has become the higher priority router in the group
hsrp-router1(config-if)# standby 1 preempt
Set Router Priority
The default priority is "100". We set here as "110" to make the Router 1 as active.
hsrp-router1(config-if)# standby 1 priority 110
Set Authentication String
This is an optional plain text 8 character string that can be used in the multicast "hello" packets toauthenticate the HSRP group.
hsrp-router1(config-if)# standby 1 authentication LocalLAN
Set Timers
Sets the time period between the "hello" packets and the hold time before assuming an activerouter is down. Default is 3seconds and 10 seconds respectively.
hsrp-router1(config-if)# standby 1 timers 5 15
Track Interface
If you track interface to check link status then the following command will track an interface andwhen the tracked link is down, the active router will mark its priority low so as to allow a Standby
router to take over.
hsrp-router1(config-if)# standby 1 track se0/0
Repeat the procedure altering the IP Address of the Local interface and the priority and thetracked interface.
Router 2:
hsrp-router2#conf t
hsrp-router2(config)# int fa0/0
hsrp-router2(config-if)# ip address 192.168.0.3 255.255.255.0
hsrp-router2(config-if)# standby 1 ip 192.168.0.1
hsrp-router2(config-if)# standby 1 preempt
hsrp-router2(config-if)# standby 1 priority 100
hsrp-router2(config-if)# standby 1 authentication LocalLAN
hsrp-router2(config-if)# standby 1 timers 5 15
hsrp-router2(config-if)# standby 1 track se0/0
-
8/4/2019 How to Configure HSRP in Cisco IOS Routers
3/6
Thats it. HSRP configuration is complete. You may test the connectivity to a remote route andsee for yourself the redudancy in place.
-
8/4/2019 How to Configure HSRP in Cisco IOS Routers
4/6
HSRP (Hot Standby Router Protocol) is the Cisco proprietary protocol for providing redundancy
in router networks. The standard router redundancy protocol which is used by other vendors is
VRRP (Virtual Router Redundancy Protocol), however Cisco has created its own proprietary
protocol (HSRP) which works very well on Cisco routers.
In a Local Area Network (LAN), all hosts (PC, Servers etc) have a single default gatewayaddress configured which is used to route packets outside the LAN. If that single default
gateway fails, then communication outside the LAN is not possible. With HSRP we can have
two gateway routers, one active and one standby, which will provide resiliency regarding the
default gateway address. Using HSRP, the two routers will have a physical IP address
configured on their LAN-facing interface, but they will have also a Virtual (HSRP address)
which will be used as the default gateway address for hosts on the LAN. No matter which
router gateway is up and running (either the primary or the secondary), the virtual HSRP
address will stay the same.
Lets see a diagram below to explain this functionality.
-
8/4/2019 How to Configure HSRP in Cisco IOS Routers
5/6
First of all, HSRP must be configured between interfaces that have Layer2 connectivity
between them. From the diagram above, HSRP will be running between interfaces FE0/1 on
the two LAN routers. Interface FE0/1 on RTR-A will have a physical IP address 10.10.10.1 and
interface FE0/1 on RTR-B will have a physical IP address 10.10.10.2. An HSRP address
10.10.10.3 will be also configured on both routers. This address will serve as the default
gateway address for all hosts on the LAN. RTR-A will be configured as the Active HSRP router
by setting a higher hsrp priority.
With HSRP, we can also track a specific interface. This means that if the tracked interface of
the active router fails, then HSRP will trigger a failover to the standby router.
Lets see an actual configuration below:
-
8/4/2019 How to Configure HSRP in Cisco IOS Routers
6/6
Cisco Router HSRP Configuration
Configuration
Router RTR-A
RTR-A(config)# int fa0/1
RTR-A(config-if)# ip address 10.10.10.1 255.255.255.0
! enable HSRP group 1 and set the virtual address to 10.10.10.3
RTR-A(config-if)# standby 1 ip 10.10.10.3
! preemptallows the router to become the active router when its priority is higher
RTR-A(config-if)# standby 1 preempt
! increase its priority to 110 to make it active (default priority is 100)
RTR-A(config-if)# standby 1 priority 110
! track the WAN interface FE0/0
RTR-A(config-if)# standby 1 track fa0/0
Router RTR-B
RTR-B(config)# int fa0/1
RTR-B(config-if)# ip address 10.10.10.2 255.255.255.0
! enable HSRP group 1 and set the virtual address to 10.10.10.3
RTR-B(config-if)# standby 1 ip 10.10.10.3
! preemptallows the router to become the active router when its priority is higher
RTR-B(config-if)# standby 1 preempt
! set priority to 100 to make it the standby router (this is the default value)
RTR-B(config-if)# standby 1 priority 100
! track the WAN interface FE0/0
RTR-B(config-if)# standby 1 track fa0/0
Thats it. Now configure a default gateway address of 10.10.10.3 for your LAN hosts.
http://www.networkstraining.com/cisco-router-hsrp-configuration/http://www.networkstraining.com/cisco-router-hsrp-configuration/