router is assigned as the default gateway for the hosts within the LAN. Communication with
external network can be realized via the virtual router.
Master router is selected from the physical routers in the virtual router group according to
VRRP priority. The elected master router provides routing service to the hosts in LAN, and
sends VRRP messages periodically to publicize its configuration information like priority
and operating condition to other routers in backup group. Other physical routers in the
backup group work as backup routers. They monitor the VRRP packets sent by the master
router. A new master router will be elected among them to take the role of the master
router if master router fails.
2.
Master Election
Initially-created routers work in Backup state and learn other members' priorities in the
virtual router via VRRP packets. The one with the highest priority is elected as master router.
If the priority values are the same, the router with the highest interface IP address is
selected as the master.
•
In preemptible mode, when backup router receives VRRP packet, it will compare its
priority with that of the advertisement packet. If of higher priority, the backup router will
become the master router; otherwise, it will maintain Backup state.
•
In non-preemptible mode, physical routers in the backup group will maintain Master or
Backup state as long as the master router functions normally. Even if backup router is
given higher priority, it cannot become a master router in non-preempt mode.
The VRRP priority ranges from 0 to 255 (the bigger the number is, the higher the priority is).
Configurable range is 1-254. The priority value 0 is reserved for the current master when it
gives up its role as master router. For example, when master router receives shutdown
message, it would send VRRP packet with priority 0 to the backup group which the interface
belongs to. The priority of the IP address owner must be 255. Therefore, if there exists an IP
address owner in the backup group and it works normally, it must be the master router.
3.
State Transition
VRRP defines three state modes: Initialize, Master and Backup. Only in Master state can
master router provide service for forwarding request via virtual IP address and forward
VRRP packet.
When the system just starts, it comes to Initialize state. If the virtual router is not given a
virtual IP address, the system would maintain Initialize state. If the virtual IP address is
configured properly, when the system receives startup message from interface, it would
transition to the Backup state (in which case its priority is not 255) or Master state (in which
case its priority is 255). Routers in master or backup state can change to Initialize state only
when they receive shutdown message from interface. In Initialize state, router cannot deal
with VRRP packet.
If the master router functions properly, it will periodically send VRRP packets informing
backup routers in the backup group that it functions properly. VRRP timer can be manually
configured to customize the intervals that master router sends VRRP packet. If the backup
router waits for a period longer than three times the advertisement timer and fails to
receive VRRP packets from the master router, they will assume that the master router is
240