Indeed, my first thought is the best place to run this is on an OpenWRT router. Perhaps as a package, or a builtin feature?