Professional Documents
Culture Documents
HSRP Introduction
HSRP Introduction
Hot Standby Router Protocol (HSRP) provides redundancy for IP networks, ensuring that user traffic
immediately and transparently recovers from first hop router failures. HSRP allows multiple routers on a
single LAN to share a virtual IP and MAC address which is configured as the default gateway on the
hosts. From the group of routers configured in an HSRP group, there is one router elected as the active
router and another as a standby router. The active router assumes the role of forwarding packets sent to
the virtual IP address. If the active router fails, the standby router takes over as the new active router.
3) Optionally you can also enable preemption on the router using below command
Standby [group-number] preempt delay{ minimum = Delay at least this long
Reload = Delay after reload
Sync = Wait for IP redundancy clients}
HSRP-enabled router with preempt configured attempts to assume control as the primary router when its
priority is higher than the current active router. The standby preempt command is needed in situations
when you want an occurring state change of a tracked interface to cause a standby router to take over
from the active router. For example, an active router tracks another interface and decrements its priority
when that interface goes down. The standby router priority is now higher and it sees the state change in
the hello packet priority field. If preempt is not configured, it cannot take over and failover does not occur.
4) Configure tracking, authentication, and timers on the primary router using the following commands:
A) Tracking: Optionally you can also enable tracking on the router using below command:
standby group_number track interface_name [cost]
When HSRP tracks an interface and the state of a tracked interface changes to down, the primary router
decrements its priority. The standby router reads this value from the hello packet priority field, and
becomes primary if this value is lower than its own priority and the standby preempt command is
configured. You can configure by how much the router must decrement the priority. By default, it
decrements its priority by 10
B) HSRP Authentication: The below command establishes authentication messages to be included in
the HSRP multicast. This ensures that only authorized routers can become part of the HSRP group. The
string must match all routers in the HSRP group.
standby [group-number] authentication { WORD=Plain text authentication string
md5=Use MD5 authentication
text=Plain text authentication}
C) HSRP timers: you can configure the time between hello packets and the time before other routers
declare the active Hot Standby or standby router to be down using following command:
standby [group-number] timers [msec] hellotime [msec] holdtime
The default hello interval is 3 seconds and hold time is 10 seconds. If the msec option is specified, hello
interval is in milliseconds.
When tracking is used, two potential situations can cause R2 to become the primary router.
1) The loss of the connection to R1, such as physical loss to the Fast Ethernet port on R1.
2) The loss of physical connectivity between R1 and ISP
Topology Diagram:
R1 R2
R1#sh run int fa0/0 R2#sh run int fa0/0
Building configuration... Building configuration...
Current configuration : 192 bytes Current configuration : 168 bytes
! !
interface FastEthernet0/0 interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0 ip address 192.168.1.3 255.255.255.0
duplex auto duplex auto
speed auto speed auto
standby 1 ip 192.168.1.1 standby 1 ip 192.168.1.1
standby 1 priority 105 standby 1 preempt
standby 1 preempt standby 1 track Serial0/0
standby 1 track Serial0/0 end
end
Verification:
Show standby Command Output for the R1 and R2:
This command shows
A) Router R1:
1) Active router
2) Virtual IP: 192.168.1.1
3) Virtual MAC address: 0000.0c07.ac01
4) Priority: 105
5) Preemption is on
6) Tracking Serial0/0, If interface S0/0 state goes down Priority will decrease by 10 i.e. 95
B) Router R2:
1) Standby router
2) Virtual IP: 192.168.1.1
3) Virtual MAC address: 0000.0c07.ac01
4) Priority: 100
5) Preemption is on
6) Tracking Serial0/0, if interface S0/0 state goes down Priority will decrease by 10 i.e. 90
An Overview of HSRP
The Hot Standby Router Protocol (HSRP) is a Cisco protocol which, as detailed
router. This "virtual" router is configured with a single IP address which is shared
among the group along with a virtual MAC address. The idea behind this is, of course,
that the client sees its one gateway even if that gateway fails. HSRP elects
or standby router can be configured to take over the forwarding of packets in the
event that the active router fails. To track each other, HSRP uses multicast to send
its HSRP updates and hellos. I could go on and on about HSRP, but I said this would
be brief!
An Overview of VRRP
Chances are, if you have a multi-vendor environment and desire the same benefits of
HSRP, you will configure the Virtual Router Redundancy Protocol (VRRP) to do this.
VRRP, detailed in RFC 3768, operates in the same manner as HSRP does by electing
an Active router called the Master among a group of routers and allowing it to be the
"keeper" of a virtual IP and MAC. As with HSRP a failure would trigger
the standby router (backup) to then become the Master and subsequently forward
the client's traffic. VRRP also uses multicast for its hello mechanism and elections,
but unlike HSRP* which uses 224.0.0.2 (This subnet) VRRP uses 224.0.0.18.
Configuration Time
Now that you have a basic understanding on how each protocol works, let's look at
Diagram – 1
Using the diagram above we are going to configure R1 and R2 for HSRP using the
R1
R1(config)# interface e0
R1(config-if)# no shut
R2
R2(config)# interface e0
R2(config-if)# no shut
We have now configured R1 and R2 for HSRP using the virtual IP address of
R1
R1(config)# interface ethernet0
R1(config-if)# no shut
R2
R2(config)# interface e0
R2(config-if)# no shut
We have now configured both HSRP and VRRP on R1 and R2. Notice in the VRRP
example that I did not use the vrrp group preempt command as I did in the HSRP
example. This is because preempt is enabled by default for VRRP. If there's a case
when you need to turn preempting off, use the command no vrrp group preempt.