Today I’ve tried out CARP, the Common Address Redundancy Protocol, which allows you to easily set up automatic failover for machines which usually become single points of failure in your infrastructure like loadbalancers, firewalls and routers.
It was so easy and quick that I made a short video demonstrating it:
# Machine 1 ifconfig carp0 create ifconfig carp0 vhid 1 advskew 100 pass foobartralala 10.8.0.130/24 # Machine 2 ifconfig carp0 create ifconfig carp0 vhid 1 advskew 200 pass foobartralala 10.8.0.130/24
If you want to make that set up permanent put something similar to your /etc/rc.conf:
cloned_interfaces="carp0" ifconfig_carp0="vhid 1 advskew 100 pass foobartralala 10.8.0.130/24"