I have a collection of devices on an ethernet network where the uplink is through WiFi. Some devices are laptops with both an ethernet controller and WiFi, and connect to the internet though Wi-Fi. A few others are ethernet-only Raspberry Pi machines. I want to have the laptops connect via Wi-Fi, and advertise an uplink for any ethernet-only devices.
If you have a single laptop, this is trivial to do, you set up a DHCP server, and accept traffic on ethernet from the Pis. However, I have more than one laptop, and want to handle the loss of a single laptop, as other laptops are likely connected through WiFi and should route the packets instead.
For a while I managed this through a set of hacky shell scripts. Recently, I rewrote this in Python, so it works on all architectures and is more reliable. The resulting system is called 'lifeline', as it provides a very reliable uplink for Ethernet-only machines.
The software works by first waiting for the Wifi device to connect. If it has a reliable Wi-Fi uplink, it checks over ethernet to see if any DHCP server is active. If so, it sets itself up as a secondary DHCP server, routinely polling to see if the primary server is down. If the primary server goes down, a single secondary takes over, providing reliable uplink to the ethernet-only devices. As a bonus, if you have flaky old Wifi adapters, running lifeline on it will ensure that the Wifi+ethernet device stays online as far as at least one functioning Wifi uplink exists, This resilience allows you to ssh into the buggy machine to fix it.
It's a simple project, but quite useful to me. It has been running for a while and I would consider it reliable enough for broader usage. It is designed for Ubuntu 26.04 and up devices. It handles tunneled traffic (like VMWare or Tailscale), and provides X11 indicator messages on state changes. It works alongside systemd, NetworkManager and dnsmasq, and has a clean status message through 'lifelinectl status'. There are man pages as well, and a lot of comments in the config files and the Python source. There are packaging scripts to create a self contained .deb for distribution. This software can work on Arch, Nix, and other distributions with little effort. The ethernet-only devices don't need this software, as they'll just request network configuration on DHCP, so they can be any machine, including Mac and Windows.
Released under GPLv3, improvements are welcome.
