Thursday, September 16, 2004

Hot Standby Routing Protocol (HSRP).

Sorry for not posting since a loong time .... been tied up with a lot of things at the same time and having sleepless nights.

HSRP is used to provide very high uptime by 2 or more routers to have a failover and its transparent ot the user.

Various methods to do this is :

Run a routing process on the host
Static default route(s)
Proxy ARP
GDP and IRDP
HSRP

We would only be speaking on HSRP here

The idea behind HRSP is to establish a virtual router (with its own IP address) as the default router for the hosts on a LAN. The virtual router also gets its own MAC address. One or more routers then pool as the standby group for this virtual router. One of the routers in the pool is active at any time, actually forwarding packets sent to the virtual router's MAC address. If that active router disappears, another router in the pool takes over. The advantage is that the host computer never knows that different routers are involved. It just sends packets to the virtual router, oblivious to the actual router that forwards the packets. And it only has to ARP once, to get the MAC address associated with the virtual router's IP address. So this saves all the ARP traffic that comes with proxy ARP. It also accomodates host implementations that ignore ARP table changes, a problem with moving a MAC address from one IP address to another (one real router's address to another's).


Configuring HSRP is easy.
All we configure is interface ethernet

ip address 131.108.1.1 255.255.255.0
standby 2 ip 131.108.1.3

On the second router attached to the Ethernet LAN: interface ethernet

ip address 131.108.1.2 255.255.255.0
standby 2 ip 131.108.1.3

This puts both routers interfaces in the same subnet, with a common standby group of 2 on that link. So both routers are responsible for acting together as the virtual router 131.108.1.3. Hosts are configured with a static default gateway, IP address that of the virtual router, 131.108.1.3.
And that's all it takes!

Point half of the LAN hosts at one virtual router, half at the other. Use different priorities (see below) so one actual router is active as the first virtual router, the other as the second virtual router. This load balances, and if either router dies, the other one takes over for it.

Once you've got this basic idea, the other HSRP commands are nerd knobs allowing you to tweak the settings. By the way, the HSRP commands are all interface commands.

The command

standby 2 timers 1 3

sets the hello and hold timers for standby group 2. These are the default values of 1 second between hellos and 3 seconds before assuming a router is down.
To control which router is active, configure standby 2 priority 90The default priority is 100, higher priority wins.

To allow a router to resume being the active router for group 2, add standby 2 preempt

There is also a command that lets you track interfaces and lower the priority if any of the interfaces is down (making the router less desirable as a default gateway). The default priority increment is 10, but you can configure other increments. Increments other than 10 are cumulative. So if several interfaces are down, the configured increments are all subtracted from the priority level of the router.

Here's what the command looks like:

standby 2 track ethernet 0 25
To monitor standby, we can use the commands we'd expect:

show standby

and

debug standby
It's that easy!