DHCP in VRRP cluster, how to configure properly?

dnsmasq stores current leases in a text file called /tmp/dhcp.leases by default in OpenWrt (it's also a configuration option you can change from UCI or Luci web interface (Network -> DHCP and DNS -> Resolv and Hosts files -> Lease File )

This is what it looks like on my OpenWrt router VM

root@VM-router:~# cat /tmp/dhcp.leases
1633703346 00:1c:42:0f:b1:c7 192.168.222.244 hostname1 01:00:1c:42:0f:b1:c7
1633703352 c4:41:1e:68:97:62 192.168.222.243 hostname2 01:c4:41:1e:68:97:62
1633703161 c0:10:b1:2c:e4:e6 192.168.123.148 * 01:c0:10:b1:2c:e4:e6
1633703141 e8:f4:08:1f:9c:67 192.168.123.69 hostname3 01:e8:f4:08:1f:9c:67

The first number is a timestamp (seconds since Unix "beginning of time" date which is somewhere in 1970, so it should be consistent with another device if the clocks are set correctly), then there is mac address of the device, then IP, then hostname (I redacted the hostnames of my devices above), then it seems another mac address but I'm not sure of what that is.

I think if you just set a cron job that scp the file from the master to the slave, the slave should know them when it's time to take over. I never tested this, but I think it should work.

Note that /tmp is a folder that lives in RAM so there is no problem with flash wearing out, you can sync this every 5 seconds, no worries

root@VM-router:~# df -h /tmp
Filesystem                Size      Used Available Use% Mounted on
tmpfs                   242.2M    360.0K    241.8M   0% /tmp