Saturday, December 24, 2016

configure vrrp between linux host and mikrotik router (HA)

*** setup information

vrid: 1
vrrp virtual address: 192.168.33.254
mikrotik ip: ether3 192.168.33.2
linux host: eth1 192.168.33.1

*** linux host
1- install vrrpd package
$ sudo apt-get install vrrpd

2- enable ip forwarding
$ sudo sysctl -w net.ipv4.ip_forward=1

3- enable nat on packets exit interface eth0
$ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERAD

4- start vrrpd daemon
$ sudo vrrpd -i eth1 -v 1 -p 200 192.168.33.254


*** on mikrotik
/ip firewall nat
add action=masquerade chain=srcnat disabled=no out-interface=ether2


/interface vrrp
add arp=enabled authentication=none disabled=no interface=ether3 interval=1s mtu=1500 name=vrrp1 on-backup="" on-master="" password="" preemption-mode=yes priority=150 v3-protocol=ipv4 version=2 vrid=1




/ip address 
add address=192.168.33.2/24 disabled=no interface=ether3 network=192.168.33.0
add address=192.168.33.254/32 disabled=no interface=vrrp1 network=   192.168.33.254



base on the priority set by both mikrotik and linux host, we see that the master will go to linux host, because its 200 priority is higher

- below is the snapshot of packet loses(2-3 packets) during the transition between master/backup



No comments:

Post a Comment