#!/bin/sh # esh-docker-vm: route the host's traffic for macvlan children over the shim (ifupdown if-up.d hook). # # Home Assistant sits on a macvlan (10.0.50.46, parent ens18). A macvlan parent cannot talk to its # own children, so the host reaches HA only through macvlan-shim (10.0.50.47, a macvlan sibling). # The shim holds a /24, which gives TWO equal connected 10.0.50.0/24 routes; ens18's is listed first # and wins, so host->HA traffic left via ens18 and was dropped. HA lost MQTT (the broker is on # this host) on 2026-08-19, 2026-09-21 and 2026-09-25, the last for two days. A /32 via the shim is # more specific than either /24, so the choice no longer depends on route order. # Installed by playbooks/esh-docker-vm-macvlan-shim-route.yaml. Add a line per macvlan child. [ "$IFACE" = "macvlan-shim" ] || exit 0 ip route replace 10.0.50.46/32 dev macvlan-shim # homeassistant