Virtual Router Redundancy Protocol Daemon

I run quite a few computers at home (too many, don't ask). Some of these are servers that I want to have a reliable internet connection, even when I'm not at home for some time. For this reason, I set up two redundant upstream gateway routers, and used ucarp to manage the automatic failover. Ucarp is a portable implementation of CARP (Common Address Redundancy Protocol). At the time, this seemed like a fairly simple and straightforward tool for the job. Unfortunately, after some time I found that it wasn't always 100% reliable, so I started looking for alternatives. I found that the selection was somewhat limited. There were some abandonware tools that hadn't been maintained for a while, some tools that only work in combination with a full Quagga router setup, etc, but nothing that was current, fully functional, and reasonably simple to set up.

So I set about to write my own. I mean, what else would you do?

My goal was to make something that is relatively simple, has relatively few external dependencies, and is preferably portable to other UNIX systems, such at *BSD, even though I develop mostly on Devuan/Debian these days.

The implementation of the core functionality is necessarily kinda tricky, as you are working on raw IP packets, not TCP or UDP, with even a bit of Ethernet MAC frame magic thrown in for good measure, and that automatically gets you into the slightly murkier parts of the socket interfaces on most systems. Still …

more ...