From Wikipedia, the free encyclopedia - View original article
The Virtual Router Redundancy Protocol (VRRP) is a computer networking protocol that provides for automatic assignment of available Internet Protocol (IP) routers to participating hosts. This increases the availability and reliability of routing paths via automatic default gateway selections on an IP subnetwork.
The protocol achieves this by creation of virtual routers, which are an abstract representation of multiple routers, i.e. master and backup routers, acting as a group. The default gateway of a participating host is assigned to the virtual router instead of a physical router. If the physical router that is routing packets on behalf of the virtual router fails, another physical router is selected to automatically replace it. The physical router that is forwarding packets at any given time is called the master router.
VRRP provides information on the state of a router, not the routes processed and exchanged by that router. Each VRRP instance is limited, in scope, to a single subnet. It does not advertise IP routes beyond that subnet or affect the routing table in any way. VRRP can be used in Ethernet, MPLS and token ring networks with Internet Protocol Version 4 (IPv4), as well as IPv6.
The protocol is described in IETF publication RFC 5798, which is an open standard, but Cisco claims that a similar protocol with essentially the same facility is patented and licensed; however in reply to a direct request Robert Barr of Cisco replied in 2001 that they will not assert any patent claims unless someone tried to assert a claim against Cisco. IBM also claims covering patents and their statement is readable on the IETF webpage.[clarification needed]
A virtual router must use 00-00-5E-00-01-XX as its Media Access Control (MAC) address. The last byte of the address (XX) is the Virtual Router IDentifier (VRID), which is different for each virtual router in the network. This address is used by only one physical router at a time, and it will reply with this MAC address when an ARP request is sent for the virtual router's IP address. Physical routers within the virtual router must communicate within themselves using packets with multicast IP address 188.8.131.52 and IP protocol number 112.
Routers have a priority of between 1-255 and the router with the highest priority will become the master. When a planned withdrawal of a master router is to take place, its priority can be lowered which means a backup router will pre-empt the master router status rather than having to wait for the hold time to expire. This reduces the black hole period.
A failure to receive a multicast packet from the master router for a period longer than three times the advertisement timer causes the backup routers to assume that the master router is dead. The virtual router then transitions into an unsteady state and an election process is initiated to select the next master router from the backup routers. This is fulfilled through the use of multicast packets.
Backup router(s) are only supposed to send multicast packets during an election process. One exception to this rule is when a physical router is configured with a higher priority than the current master, which means that on connection to the network it will preempt the master status. This allows a system administrator to force a physical router to the master state immediately after booting, for example when that particular router is more powerful than others within the virtual router. The backup router with the highest priority becomes the master router by raising its priority above that of the current master. It will then take responsibility for routing packets sent to the virtual gateway's MAC address. In cases where backup routers all have the same priority, the backup router with the highest IP address becomes the master router.
All physical routers acting as a virtual router must be in the same LAN segment. Communication within the virtual router takes place periodically. This period can be adjusted by changing advertisement interval timers. The shorter the advertisement interval, the shorter the black hole period, though at the expense of more traffic in the network. Security is achieved by responding only to first hop packets, though other mechanisms are provided to reinforce this, particularly against local attacks. Election process is made orderly through the use of skew time, derived from a router's priority and used to reduce the chance of the thundering herd problem occurring during election. The skew time is given by the formula (expressed in milliseconds) RFC 3768 .
Backup router utilization can be improved by load sharing. For more on this, see RFC 5798.
Example: Configuring VRRP from JUNOS http://www.juniper.net/techpubs/en_US/junos13.2/topics/example/vrrp-configuring-example.html
VRRP is based on Cisco's proprietary Hot Standby Router Protocol (HSRP) concepts. The protocols, while similar in concept, are not compatible.
track 1 interface Serial0/0/0.1 ip routing ! Points at the interface that needs to be Prioritized interface fastethernet0/0.1 ! VLANs have to be on a Sub-Interface, It is best practice to match the Sub-Interface # and the VLAN # encapsulation dot1q 1 ! Enables IEEE 802.1Q VLAN frame tagging, followed by the VLAN # that this sub-interface will route ip address x.x.x.x 255.255.255.0 ! Make sure the IP is on the same subnet as the virtual Gateway1 vrrp 1 priority 110 ! The Priority of the Gateway1 vrrp 1 ip <Gateway1> ! The Virtual Gateway for the VLAN 1 vrrp 1 preempt delay minimum 20 ! If the other router fails it will wait 20 sec before becoming the master vrrp 1 track 1 decrement 15 ! If the S0/0/0.1 Link fails, This command drops the priority by 15 ! interface fastethernet0/0.5 ! VLANs have to be on a Sub-Interface, It is best practice to match the Sub-Interface # and the VLAN # encapsulation dot1q 5 ! Enables IEEE 802.1Q VLAN frame tagging, followed by the VLAN # that this sub-interface will route ip address x.x.x.x 255.255.255.0 ! Make sure the IP is on the same subnet as the virtual Gateway2 vrrp 5 priority 110 ! The Priority of the Gateway2 vrrp 5 ip <Gateway2> ! The Virtual Gateway for the VLAN 5 vrrp 5 preempt delay minimum 20 ! If the other router fails it will wait 20 sec before becoming the master vrrp 5 track 1 decrement 15 ! If the Fa0/0.5 Link fails, This command drops the priority by 15 ! router bgp <ASN> network <Gateway1> mask 255.255.255.0 ! Broadcasts Gateway1 out the WAN through BGP network <Gateway2> mask 255.255.255.0 ! Broadcasts Gateway2 out the WAN through BGP