As you see in the thumbnail, that network diagram we are going to implement and follow various scenarios of VRRP working in detail with packet flow. This is practical design on customer site connected to MPLS , devices and link are kept independent for Redundancy. Generally 2 Links are used however I tried with Tertiary link too.
Configuration of all PE and Routers are in the snapshot below. Since the study is on VRRP we can Pre-build the network with config and keep it ready.
PE Configuration:-
Router Configuration:- R2 VRRP Config need Track 1 decrement 10 (Please correct)
VRRP Status:-
Tracking Method:- It really depends on the design how we got to track the Main link for fail over. General practice is to track the route which is consistent because other tracking method can create high flapping causing problems to Router functioning.
1. IP SLA based Object Tracking
We practice this scenario when there isn’t routing protocol on WAN interface, and high latency is observed in WAN then we could use multiple logic in IP SLA way of tracking. One of that is sending ICMP packets to certain IP on WAN side and in the event of packet loss there will be track down causing the fail over. There can various feature on ICMP that can be tracked like latency, jitter etc even the start time and end-times can be set.
R1(config)#track 1 ip sla 1 reachability
R1(config)#ip sla 1
R1(config)#icmp-echo 8.8.8.8
R1(config)#ip sla schedule 1 life forever start-time now
2. Route lookup based Object Tracking
This is ideally way however this requires a routing protocol to be there in WAN link, the routes will go off only when the timers expires for it and restoration also been maintained with timer. hence Flapping of Tracks would not be that frequent maintaining the sanity of the Router process.
R1(config)#track 1 ip route 8.8.8.8 255.255.255.255 reachability
3. Interface based Object Tracking.
This will track the line protocol status of the WAN interface connecting Main link. However has the drawback if the link is connected with many intermediate devices then end device link status remains always up even if the intermediate devices goes down. If the interface flap occurs then that would cause track to flap in high frequency causing the fail-over too frequent for the network.
R1(config)#track 1 interface gigabitEthernet 1/0 line-protocol
R1(config-track)#exit
Normal Scenario:- We are going to remove all the VRRP config from Routers and configure one by one and how the behavior will be is explained
1. When you configure the first interface of VRRP that will become Master and it will send broadcast announcement every second to Multicast IP.
Source MAC:- 5e:1:1 (last digit is group Number of VRRP) to Destination MAC 5e::12
Source IP:- physical IP i.e. 50.0.0.2 and Destination IP:- 228.0.0.18 Multicast
Announcement Packet
2. As soon as the second interface is configured in that VRRP Group it becomes from Init to Backup, and interface listen for few seconds if any VRRP protocol announcement is coming from any Master. If any announcement is received then it verifies the priority with its own priority. If its own priority is lower then annouced Master value, then it will simply listen and keep comparing. Remember all the backup devices will never send any updates or keep alive or announcement in the Network, it will just listen to Master announcements only.
Logs as you see interface came UP and become backup, receives announcement from 50.0.0.2 with priority 105 and compares all the time.
But if second interface which is configured is of higher priority then the Master announcement, then it will make Event – Master down and will become Master by sending Gratuitous ARP and start broadcasting announcement every second. The announcement will have the details of all as in below with priority value.
Source MAC:- 5e:1:1 (last digit is group Number of VRRP) to Destination MAC 5e::12
Source IP:- physical IP i.e. 50.0.0.3 and Destination IP:- 228.0.0.18 Multicast
Log as you see it remained in backup but after putting the command 110 priority, the announcement of Master priority 105 is compared with 110 in couple of second it made event Master down. It became Backup and started sending Announcement:-
Note:- Whenever the Master change happens there will be three Gracious ARP generated Broadcast and UplinkFast, It will have opcode 2 which states the switch to update the MAC address. I’m not sure if UplinkFast is anything to do with STP but the other Broadcast informs the Switch to update MAC three times each time a Master change happen. Above is the 3 times of packet in network.
Below shown packet of Gracious ARP And UplinkFast:-
3. When the third interface comes up in the same VRRP group, it will start from INIT to Backup and then listen for any VRRP announcement, compares its priority and stays in Backup if priority is lower. It will not advertise anything out until the priority is less. If higher then it will follow the above step 2 of making Event Master down and becoming Master followed by broadcasting announcement. Also If no announcement is listened during activation for 3 sec then it will become Master and start sending announcement.
Logs of interface coming up and becoming Backup followed by listening to announcement of Master and it comparing its own priority.
Failover 1:- In the event of Track going down for various reason of WAN failure, then fail-over will happen. Behavior of other Routers is explained.
Primary link is down or Route 8.8.8.8 is not received, then track would go down causing the priority to be decrement by 20 then Master will change its priority and make the announcement to all, as you can see below.
When track goes down the priority is decreased by 20, hence Master announcing with priority 90 now from 110.
In my understanding, Now the New Master 50.0.0.3 makes a Gratuitous ARP with opcode 2 to L2 Broadcast FF:FF to make a MAC entry change to L2 domain. This is merely informing all the L2 devices to flush the MAC and update with new MAC for destination IP 50.0.0.1
Source MAC:- 5e:1:1 (last digit is group Number of VRRP) to Destination MAC FF::FF
Source IP:- physical IP i.e. 50.0.0.1 and Destination IP:- 50.0.0.1
Packet of Gratuitous ARP followed by STPUplink:-
50.0.0.3 Announcement of priority 110 in the network.
Also you can see R3 is also becoming Master and sending a Gracious ARP by making an announcement, this is because announcement sent by Master 50.0.0.1 was having priority 90 hence R3 which is priority 100 become master and sent gracious ARP followed by announcement. However during this time there wasn’t any R2 announcement received that’s why R3 felt it has Master. But as soon as the announcement of R2 50.0.0.3 is came to R3, the priority is compared and R3 become Backup and stopped announcement.
Gratious ARP of R3 sent:-
R3 Annoucement:-
As you can see Primary track going down and respective R2 and R3 routers changing its state accordingly.
Failover 2:- In the Event of R2 going down, while R1 is also still down. Then R2 will make priority to 85 by decrementing 20 and R3 would receive priority 90 then it will compare to its own which is default 100. Then will make the event of Master down followed by sending Gratuitous ARP. Then it will start announcement by becoming Master. You can imagine the packet flow.
Fallback :- When primary link goes up the track will up and priority will become 110 again, the behavior of other Routers is explained.
Now R1 will become Master as its priority is 110 when compared to R2 announcement of 105. Hence R1 will send Gratuitous ARP followed by its announcement.
Note:- After each Master change there are 3 Gratuitous ARP sent with opcode 2 to make a MAC flush and update with New MAC for 50.0.0.1 IP in L2 devices.
Packet of R1 Taken over:-
Logs:-
R3 Stays silent as its priority is still less from previous announcement.
Note :- We don’t have to worry much about two more cases, where the secondary link goes down while primary is still up. As primary would stay Master and will receive traffic, the election will happen for Backup state based on priority. Also in the event of tertiary link goes down while primary and sec is still up, will be null event as in VRRP priority is mostly to find Master and Backup.
Special USED CASE 1:- PRI And SEC is MASTER and MASTER.When link between Switches go Down or if there is issue in Switch configuration due to which L2 packet of VRRP can’t flow between routers. Even chances are there of Router LAN interface having ACL which blocks VRRP packets. In such case both Primary and Secondary stays Master.
As you can see the announcement of Primary Master is always going on since there is no new announcement received to compare, hence the Primary will be always Master. However the Secondary stopped receiving announcement from Master hence it will make the Master timer down, make its state to Master and start sending advertisement. The end user of switch 1 will send their traffic to R1 as switch 1 will have the MAC for 50.0.0.1 and users of switch 2 will send their traffic to R2 as this also holds MAC for 50.0.0.1. This behavior can happen if there is ACL in Router LAN interface which blocks the VRRP packets.
Special USED CASE 2:- There can be situation we had to use /30 in LAN with failover needed, VRRP can come handy. In VRRP we can use the physical IP also as VRRP IP, however the router which holds the physical IP as VRRP IP will by-default has the priority of 255 and always stays as MASTER, it will over rule the priority configured in Interface.
In this example, I purposefully used VRRP IP: 50.0.0.2 using the Secondary Physical IP. Though the primary has the priority of 120, and Track is UP too. The secondary becomes the Master due to higher priority. Hence whenever you use physical IP as VRRP IP, make sure it is always used for Primary Physical IP.
R1:- Primary Config.
interface GigabitEthernet1/0
ip address 50.0.0.2 255.255.255.252
negotiation auto
vrrp 1 ip 50.0.0.3
vrrp 1 priority 110
vrrp 1 track 1 decrement 20
R2:- Secondary Config.
interface GigabitEthernet1/0
ip address 50.0.0.3 255.255.255.252
negotiation auto
vrrp 1 ip 50.0.0.3
vrrp 1 priority 105
end
When Interface is activated, it became Master.
When Sec port came up, it checks VRRP IP with its physical and immediately become Master
R1 was Master initially sending advertisement with Priority of 110.
R2 become master having priority 255, though the configured value on interface is 105.
Note:- All designated gateway packets coming from end user are in same L2 domain so underlined switch will observe the MAC only, Since only the Master is advertising all the time as broadcast with source MAC 5e:1:1 and Destination MAC 5e::12 Multicast. The Switches will cache the MAC 5e:1:1 of Master in respective port it received each time. Whenever the gateway packet comes the switch will look at the last port that have the MAC 5e:1:1 will forward to that port in turn going to Router which is the Master having Gateway IP and forwards to WAN.
Some VRRP Interview Questions:-
1. What is VRRP?
Ans:- VRRP stands for Virtual Router Redundancy Protocol
VRRP is an IP routing redundancy protocol designed to allow for transparent failover at the first-hop IP router.
2. What is the protocol number of VRRP?
Ans:- 112
3. What is the use of VRRP?
Ans:- VRRP is used to provide default gateway redundancy
4. What is the default VRRP Proirity?
Ans:- The default VRRP Priority is 100
You can configure the priority of each backup virtual router with a value of 1 through 254 using the VRRP priority command.
5. What are the VRRP default hello and hold down Timers.
Ans:- Hello timer is 1 sec and Hold Down Timer – 3
6. Which protocol is used in VRRP to communicate with other routers?
Ans:- IP Protocol 112 is used in VRRP to communicate with other routers.
Which Multicast IP address is used in VRRP?Multicast IP 224.0.0.18 is used in VRRP.
7. Is it necessary to configure Preempt command in VRRP?
Ans:- No, by default Preemption is enabled in VRRP.
8. How we can achieve rudundancy if WAN link is down?
Ans:- By using Event Tracking, we can achieve redundancy if WAN link down by decreasing the VRRP Priority.
Decreased priority should be less then Backup Priority.
9. Which IP address will get in trace-route physical or Virtual IP?
Ans:- Physical IP address
10. Is it possible to use a real interface IP address as a Virtual address in VRRP?
Ans:- Yes, you can use physical inteface IP as vritual IP address.
11. What is the role of Master Router in VRRP?
Ans:- The master router takes up the responsibility of forwarding the local traffic
The router in VRRP is elected as a master router on the basis of priority, if some group memmber of VRRP group has higher priority than others then itwill be elected as Master router.
12. Which is the VRRP Virtual MAC Address?
Ans:- VRRP Virtual MAC Adress – 0000.5E00.01xx – “xx” – hexadecimanl group number of VRRP.
Thank you for the read this far, wish you good luck!!
(5 votes, average: 4.60 out of 5)
Hi Ramesh,
Thanks a lot for this VRRP detailed concepts. It helps me a lot to understand VRRP in depth.
Asendra Singh
Hi Ramesh
Deep Devine knowledge, splendid way of explaining… thankyou so much for sharing this with us…