Skip to content

v0.3.0 - restart on newly-appeared IPv4 subnet (FR-40)

Choose a tag to compare

@pereljon pereljon released this 31 Jul 06:05

Restart on a newly-appeared IPv4 subnet (FR-40)

dynavlan now restarts the nominated RESTART_SNAPS/RESTART_SERVICES whenever a new global-IPv4 subnet appears on any interface, not only on a tagged-VLAN change. This closes two gaps:

  • An access port or native-only trunk that leases after boot (no tagged VLAN, so nothing was changing before).
  • The monitoring agent starting before the base interface finishes DHCP at boot (dynavlan's boot run is deliberately not ordered after network-online.target).

Both are the same underlying problem: the agent cares about IPv4 subnets it can scan, not VLAN tags.

Behavior

  • New pure helper ipv4_network keys subnet tokens on the network address, not the host address, so a same-pool DHCP renewal never restarts.
  • A monotonic per-uptime seen-set at /run/dynavlan/seen (wiped on reboot): a flap back onto an already-seen subnet doesn't restart; an empty seen-set at boot restarts once after settle regardless of boot-vs-DHCP ordering.
  • At most one restart per run, deduped against any VLAN-driven restart.
  • --dry-run / --status report the would-restart delta without restarting or writing the seen-set.
  • apply_change (the accept/rollback chain) is unchanged; the growth-check is an additive post-step in main.

Config

  • New key RESTART_ON_NEW_SUBNET (default true). No-op when no restart targets are configured.

Validation

  • Unit suite 139/0; per-task, architect, and whole-branch reviews clean.
  • Hardware-validated on a Protectli box with the real Domotz snap: access-port and boot-race restarts, same-subnet/flap/disappearance no-restart, and read-only --dry-run/--status, across UniFi and Meraki.

Full detail in CHANGELOG.md and docs/dynavlan-PRD.md (FR-40).