cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
10722
Views
5
Helpful
10
Replies

hsrp election if both gateway has same priority, configured for preempt?

gavin han
Level 1
Level 1

who becomes hsrp active if both gateways have same priority and configured for hsrp preempt?

10 Replies 10

John Blakley
VIP Alumni
VIP Alumni

If the priorities are the same, the highest physical address will be selected as active in the group.

Assigning priority helps select the active and standby routers. If preemption is enabled, the router with the highest priority becomes the designated active router. If priorities are equal, the primary IP addresses are compared, and the higher IP address has priority.

Interestingly, in testing, it seems that if a single router becomes active in the group and the standby comes up, configured with a higher IP address, the router does not actively take over. This could be an IOS issue with the version that I'm using for testing.

HTH,

John

HTH, John *** Please rate all useful posts ***

Now that I think about it, you're preempt command overtakes a lower priority. If you have the same priority, I would think the preempt command would have no effect. So in this case, the higher address doesn't seem to matter and the first router hat comes up and takes the active role is the active permanently. 

 

Its always better  to control your priorities so you'll know which will be the active in the group. 

 

Hth,

john

HTH, John *** Please rate all useful posts ***

I believe that the part about the higher IP address comes into play at the point where an election is taking place and you need a tie breaker. Once the election has taken place then I believe that higher IP address no longer is considered and then it is a question of preempt if a device has a higher priority (but not necessarily a higher IP address).

 

HTH

 

Rick

HTH

Rick

Rick,

That's what I'm noticing too:

 

R2(config-if)#
*Mar  1 00:20:52.727: HSRP: Fa0/0 Grp 1 Hello  out 192.168.12.122 Active  pri 120 vIP 192.168.12.1
*Mar  1 00:20:53.167: HSRP: Fa0/0 Grp 1 Hello  out 192.168.12.122 Active  pri 120 vIP 192.168.12.1
R2(config-if)#
*Mar  1 00:20:54.135: HSRP: Fa0/0 Grp 1 Hello  in  192.168.12.123 Standby pri 120 vIP 192.168.12.1

R2(config-if)#
*Mar  1 00:20:55.727: HSRP: Fa0/0 Grp 1 Hello  out 192.168.12.122 Active  pri 120 vIP 192.168.12.1
*Mar  1 00:20:56.395: HSRP: Fa0/0 Interface adv in, Passive, active 0, passive 1, from 192.168.12.123
R2(config-if)#
*Mar  1 00:20:57.151: HSRP: Fa0/0 Grp 1 Hello  in  192.168.12.123 Standby pri 120 vIP 192.168.12.1
R2(config-if)#
*Mar  1 00:20:58.727: HSRP: Fa0/0 Grp 1 Hello  out 192.168.12.122 Active  pri 120 vIP 192.168.12.1
R2(config-if)#
*Mar  1 00:21:00.167: HSRP: Fa0/0 Grp 1 Hello  in  192.168.12.123 Standby pri 120 vIP 192.168.12.1
R2(config-if)#

It doesn't matter if preempt is enabled or not. As soon as you change the priority:

 

*Mar  1 00:21:57.151: HSRP: Fa0/0 Grp 1 Hello  in  192.168.12.123 Standby pri 120 vIP 192.168.12.1
*Mar  1 00:21:58.727: HSRP: Fa0/0 Grp 1 Hello  out 192.168.12.122 Active  pri 120 vIP 192.168.12.1
*Mar  1 00:21:58.759: HSRP: Fa0/0 Interface adv in, Active, active 1, passive 1, from 192.168.12.123
*Mar  1 00:21:58.771: HSRP: Fa0/0 Grp 1 Coup   in  192.168.12.123 Standby pri 121 vIP 192.168.12.1
*Mar  1 00:21:58.771: HSRP: Fa0/0 Grp 1 Active: j/Coup rcvd from higher pri router (121/192.168.12.123)
*Mar  1 00:21:58.775: HSRP: Fa0/0 Grp 1 Active router is 192.168.12.123, was local
*Mar  1 00:21:58.775: HSRP: Fa0/0 Nbr 192.168.12.123 active for group 1

It immediately switches...

John

HTH, John *** Please rate all useful posts ***

John

 

This is a nice test of the function. Thanks for sharing it. There is one thing that needs clarification. You say "It doesn't matter if preempt is enabled or not". Actually it should matter a great deal. If the peer with priority changed to 121 does not have preempt configured then the active will not change. Notice the message "Coup rcvd from higher pri router ". A HSRP participant will only generate a coup message if it has a higher priority AND it is configured with preempt.

 

HTH

 

Rick

HTH

Rick

Rick,

I meant that it seemed like if the priorities are the same, regardless of preempt, I couldn't get it to take the active role based solely on it having a higher ip address on the interface. That could have been a flaw in the test. I tested by bringing up the lower addressed router interface first and letting it take over the active role. With debugs running, I brought up the second router with the same priority and higher ip address. There were no changes in debugs in that it saw the higher address come up as slave and just continued the hello process. But even with preempt enabled on the second router that I brought up, it didn't take over that role.

Thanks!

John

 

HTH, John *** Please rate all useful posts ***

John

 

Thanks for the explanation. I understand your point better now. I was interpreting your comment that "It doesn't matter if preempt is enabled or not" to apply to the next phrase "As soon as you change the priority" and not to the phrase before it that refers to equal priority and higher address. So we both understand it the same way and agree that once past the election that the higher IP address no longer plays a part in selecting the active router for HSRP.

 

HTH

 

Rick

HTH

Rick

Thank you all. could hsrp flip at anytime without reason if both gateways have same priority and preempt configured?

From my testing, no....It would need to be a hard down on the active for the secondary to take over.

HTH, John *** Please rate all useful posts ***

The choice of active router for HSRP could change at any time. But there would need to be some reason (loss of communication between peers or change of priority or something). So in the way that you specify the question no there could not be a flip in HSRP for no reason.

 

HTH

 

Rick

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: