The Virtual Router Redundancy Protocol (VRRP) - Solution Examples

2,461 views

Published on

VRRP - Configuration Examples

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,461
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
70
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

The Virtual Router Redundancy Protocol (VRRP) - Solution Examples

  1. 1. Manual:VRRP-examples 1 Manual:VRRP-examples Applies to RouterOS: v3, v4 VRRP Configuration Examples This section contains several useful VRRP configuration examples Basic Setup This is the basic VRRP configuration example. According to this configuration, as long as the master, R1, is functional, all traffic destined to the external network gets directed to R1. But as soon as R1 fails, R2 takes over as the master and starts handling packets forwarded to the interface associated with IP(R1). In this setup Router R2 is completely idle during Backup period.
  2. 2. Manual:VRRP-examples 2 Configuration R1 configuration: /ip address add address=192.168.1.1/24 interface=ether1 /interface vrrp add interface=ether1 vrid=49 priority=254 /ip address add address=192.168.1.254/32 interface=vrrp1 R2 configuration: /ip address add address=192.168.1.2/24 interface=ether1 /interface vrrp add interface=ether1 vrid=49 /ip address add address=192.168.1.254/32 interface=vrrp1 Testing First of all check if both routers have correct flags at vrrp interfaces. On router R1 it should look like this /interface vrrp print 0 RM name="vrrp1" mtu=1500 mac-address=00:00:5E:00:01:31 arp=enabled interface=ether1 vrid=49 priority=254 interval=1 preemption-mode=yes authentication=none password="" on-backup="" on-master="" and on router R2: /interface vrrp print 0 B name="vrrp1" mtu=1500 mac-address=00:00:5E:00:01:31 arp=enabled interface=ether1 vrid=49 priority=100 interval=1 preemption-mode=yes authentication=none password="" on-backup="" on-master=" As you can see vrrp interface mac addresses are identical on both routers. Now to check if vrrp is working correctly, try to ping virtual address from client and check arp entries: [admin@client] > /ping 192.168.1.254 192.168.1.254 64 byte ping: ttl=64 time=10 ms 192.168.1.254 64 byte ping: ttl=64 time=8 ms 2 packets transmitted, 2 packets received, 0% packet loss round-trip min/avg/max = 8/9.0/10 ms [admin@client] /ip arp> print Flags: X - disabled, I - invalid, H - DHCP, D - dynamic # ADDRESS MAC-ADDRESS INTERFACE ... 1 D 192.168.1.254 00:00:5E:00:01:31 bridge1 Now unplug ether1 cable on router R1. R2 will become VRRP master, ARP table on client will not change but traffic will start to flow over R2 router. Load sharing In basic configuration example R2 is completely idle during Backup state. This behavior may be considered as waste of valuable resources. In such circumstances R2 router can be set as gateway for some clients. The obvious advantage of this configuration is the establishment of a load-sharing scheme. But by doing so R2 router is not protected by current VRRP setup. To make this setup work we need two virtual routers.
  3. 3. Manual:VRRP-examples 3 Configuration for V1 virtual router will be identical to configuration in basic example - R1 is the Master and R2 is Backup router. In V2 Master is R2 and Backup is R1. With this configuration, we establish a load-sharing between R1 and R2; moreover, we create protection setup by having two routers acting as backups for each other. Configuration R1 configuration: /ip address add address=192.168.1.1/24 interface=ether1 /interface vrrp add interface=ether1 vrid=49 priority=254 /interface vrrp add interface=ether1 vrid=77 /ip address add address=192.168.1.253/32 interface=vrrp1 /ip address add address=192.168.1.254/32 interface=vrrp2 R2 configuration: /ip address add address=192.168.1.2/24 interface=ether1 /interface vrrp add interface=ether1 vrid=49 /interface vrrp add interface=ether1 vrid=77 priority=254 /ip address add address=192.168.1.253/32 interface=vrrp1 /ip address add address=192.168.1.254/32 interface=vrrp2
  4. 4. Manual:VRRP-examples 4 VRRP without Preemption Each time when router with higher priority becomes available it becomes Master router. Sometimes it is not desired behavior which can be turned off by setting preemption-mode=no in vrrp configuration. Configuraton We will be using the same setup as in basic example. Only difference is during configuration set preemption-mode=no. It can be done easily modifying existing configuration: /interface vrrp set [find] preemption-mode=no Testing Try turning off R1 router, R2 will become Master router because it has highest priority among available routers. Now turn R1 router on and you will see that R2 router continues to be Master even if R1 has higher priority. VRRP and scripts See Also • VRRP • Scripting [ Top | Back to Content ]
  5. 5. Article Sources and Contributors 5 Article Sources and Contributors Manual:VRRP-examples  Source: http://wiki.mikrotik.com/index.php?oldid=21961  Contributors: Janisk, Marisb Image Sources, Licenses and Contributors Image:Version.png  Source: http://wiki.mikrotik.com/index.php?title=File:Version.png  License: unknown  Contributors: Normis Image:vrrp-basic.png  Source: http://wiki.mikrotik.com/index.php?title=File:Vrrp-basic.png  License: unknown  Contributors: Marisb Image:vrrp-load-sharing.png  Source: http://wiki.mikrotik.com/index.php?title=File:Vrrp-load-sharing.png  License: unknown  Contributors: Marisb

×