15.1.3 How to select a master
- <Structure of this section>
(1) Priority
VRRP uses priority to select the master virtual router from a group of virtual routers. This priority can be set for a virtual router. Possible values are numbers between 1 and 255. The default is 100. Larger values indicate higher priority. When the real IP address assigned to a virtual router's interface is the same as the virtual router's virtual IP address, the virtual router is the IP address owner and automatically has the highest priority (255). The following figure shows how the master virtual router is selected.
|
In this figure, switch A is the master virtual router because it has the highest priority. If switch A goes down, switch B becomes the master virtual router because it has the next highest priority. Switch C becomes the master virtual router only if both switches A and B go down.
To be able to select the master router unambiguously, assign different priorities to the virtual routers that have the same virtual router identifier on the same Ethernet LAN. If multiple virtual routers have the same priority, you will not know which router becomes the master. This could result in unintended operation.
(2) Suppressing automatic switchback and automatic switchback
In VRRP operation, if a backup virtual router discovers that the master virtual router has a lower priority that itself, the backup virtual router automatically becomes the master. If the master virtual router detects a backup router with a higher priority than itself, the master virtual router automatically becomes a backup.
As an example of the configuration in Figure 15-4: Selecting a master, when virtual router B recovers from the state where virtual router A and virtual router B are down and virtual router C is the master, virtual router B, which has a higher priority than virtual router C, changes to the master, and virtual router C changes from the master to the backup state.
You can suppress this automatic preemption by using either of the following methods.
-
Using PREEMPT mode
If you prefer to suppress automatic switch-back, use the no vrrp preempt configuration command to turn off PREEMPT mode. When you turn off PREEMPT mode, a backup virtual router with a higher priority than the master virtual router does not become the master.
-
Using a suppression timer
If you want to delay the start of automatic switch-back for a particular period, use the vrrp preempt delay configuration command to configure the suppression timer. The timer value delays the start of automatic switch-back processing after a cause for invoking automatic switch-back is detected.For automatic switch-back to be completed, the specified length of time and several additional seconds are required.
Whether you use PREEMPT mode or the suppression timer, automatic switch-back cannot be used if the applicable VRRP router is the IP address owner (priority: 255).
If a backup router detects that the master virtual router is inoperable due to a failure and the backup router knows it has the highest priority among the remaining routers, it becomes the master even if automatic switch-back is suppressed.
-
Manual switch-back
When automatic switch-back is suppressed, you can use the swap vrrp operation command to start switch-back processing for virtual routers.
When you specify this command for a router remaining in the backup state due to automatic switch-back suppression, the router becomes the master if it has a higher priority than the master virtual router at the time the command is executed.