How to Configure HSRP for Gateway Redundancy
To configure HSRP: on each router's LAN interface, assign the same HSRP group and virtual IP, then set priority and enable preemption on the preferred router. Hosts use the virtual IP as their gateway.
HSRP gives a LAN a gateway that survives a router failure. See the HSRP lab.
Step 1: Configure the virtual IP on both routers
interface gi0/0standby 1 ip 192.168.1.254 | Both routers share HSRP group 1 with this virtual gateway IP |
Step 2: Set priority on the preferred router
On the preferred router:standby 1 priority 110 | Higher priority (default 100) becomes Active |
Step 3: Enable preemption
standby 1 preempt | Lets the recovered high-priority router reclaim Active — off by default! |
Verification
show standby brief confirms which router is Active/Standby and the virtual IP. Test by shutting the Active router's interface — the Standby takes over within seconds and a continuous ping barely blips.
Frequently asked questions
How do I configure HSRP on a Cisco router?
On each router's LAN interface: standby [group] ip [virtual-ip], the same on both. Then set priority on the preferred router and enable standby preempt.
What is the HSRP virtual IP?
A gateway address owned by the HSRP group, not any single router — hosts use it as their default gateway, and whichever router is Active answers for it.
Why do I need standby preempt?
Without it, a recovered higher-priority router stays Standby. Preempt lets it reclaim the Active role automatically.
How do I verify HSRP failover works?
Run a continuous ping to the virtual IP, then shut the Active router's interface — replies should resume within seconds as the Standby takes over.
Related articles
Want hands-on training?
Learn this on real Cisco lab devices with placement support at Attila Technologies, Ahmedabad.