Manual:VRRP-examples
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.
Configuration
R1 configuration:
/ip address add address=192.168.1.1/24 interface=ether1 /interface vrrp add interface=ether1 vrid=49 priority=255 /ip address add address=192.168.1.1/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.1/32 interface=vrrp1
Testing
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.
Configuration for V1 virtual router will be identical to configuration in basic example - R1 is the Owner and R2 is backup router. In V2 Owner 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=255 /interface vrrp add interface=ether1 vrid=77 /ip address add address=192.168.1.1/32 interface=vrrp1 /ip address add address=192.168.1.2/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=77 /ip address add address=192.168.1.1/32 interface=vrrp1 /ip address add address=192.168.1.2/32 interface=vrrp2