Step-by-Step With Cisco's Hot Standby Router Protocol - Page 2
The Hot Swappable Router Protocol (HSRP) is a way to build redundancy into your network by allowing two or more routers to continuously test each other for connectivity, and take over if a router fails. For purposes of discussing a basic HSRP configuration, let's assume we want to make the 10.10.10./24 network dynamically redundant and have two building routers at our disposal.
Using HSRP terminology, both building routers together are referred to as a standby group and appear to the subnet as a single default gateway. Through an election process, one router is designated as active and the other router is designated as standby. Both the active and standby router listen to routing updates from the core router, but only the active router processes IP packets as the default gateway for the subnet. The active and standby routers are constantly sending "hello" packets back and forth. If the active router fails, as soon as a predetermined number of "hello" packets from the standby router to the active router go unanswered, the standby router becomes the active router and starts processing IP packets for the subnet.
Both routers are configured with standard IP addresses on their interface into the subnet. Each router also has a special virtual IP address which is the same on both routers, configured via standby commands under the specific interfaces.
Configuring the Routers
- Network: 10.10.10.0
- Subnet Mask: 255.255.255.0
- Default Gateway: 10.10.10.251
Physical IP Address
- Building Router A: 10.10.10.252
- Building Router B: 10.10.10.253
The configuration commands are as follows:
building router a# interface fa0/2 ip address 10.10.10.252 255.255.255.0
This sets the IP address for the interface
standby 100 timers 3 10100 denotes the HSRP process number as "hot standby group 100". You can have multiple HSRP standby groups on the same interface. The timers command sets the interval to 3 seconds between HELLO messages, and waits 10 seconds before the other router is declared down.
standby 100 priority 200 preempt
Defines the priority of this router. The highest priority number will win the election. "Preempt" allows the router to take over control even if there is not an election in process if it comes on line with the highest priority.
standby 100 authentication fnord
Optional - Authentication [word] creates an unencrypted authentication process for each HSRP packet.
standby 100 ip 10.10.10.251
Establishes 10.10.10.251 as the virtual interface. This IP address should be the same on both HSRP routers.
standby 100 track fa0/0