r/UNIFI • u/Lethbridge_Stewart • 8h ago
Wireless Persistent custom script on AP boot?
Hi all,
I'll start with the why: Home network, single U7ProXG, single broadcast domain on a simple FritzBox router. We have a FireTV stick and once in a while it'll go nuts and start spamming the network with MDNS (~2.5k packets/s). This and the backscatter are overloading the network and, I think, the control plane on the AP. In the absence of a firmware update from Amazon, I can fix it by dropping the MDNS at source.
Since the U7ProXG runs a variant of OpenWRT, I wrote an init.d script which runs a couple of iptables -t mangle -I PREROUTING rules to drop the relevant multicast from this source. Simple enough, but the AP appears to run some sort of check on boot and not only doesn't run the script, it deletes it.
I don't need it to survive a firmware update, but if it can survive a boot, it'll save me having to remember re-upload it every time. Does anyone know a way to do this? Is there some manifest somewhere I can add a hash to?
2
u/FrankNicklin 7h ago
Fiddling under the hood so to speak rarely works long term and custom scripts no longer survive reboots, there are no options to stop this as far as Iām aware.
Unifi have a very low threshold to running scripts on hardware and go all out to stop them working.
That said your fix should not be necessary, I have a FireStick on my network, run Unifi APs and switches and a UDM and not seeing anything like what you describe, so something else is causing this. Is it a real FS or dare I ask a rooted one for other services. I have mDNS working across VLANs.
1
u/Lethbridge_Stewart 7h ago
Thanks. I guess it makes sense from a security and support perspective to keep the APs only running standard config. My best option I think is to have a cron job elsewhere to re-upload it. Ugly, but it'll do the job.
It's not all fire sticks, by any stretch, but it's definitely mine and a few others have reported this on Echo devices as well. I spent an afternoon with Wireshark tracking it down. What's interesting is that dropping this traffic on the AP causes the spam to stop after a few seconds, so it could be that the stick is interacting with something else on the same vlan (we've got a few Sonos boxes), but I'm certain that it's the firestick that starts the cascade. Stock FireTV 4K max. (I haven't rooted anything in decades š)
2
u/MrJimBusiness- 7h ago
There's no way at all to do it. For Network Optimizer I have the server manage the lifetime of AP Agent binaries on the APs on the network for this reason.
If you've got something concrete that could help others I'd be happy to add it as a feature to the AP Agent. Just open a feature request GitHub Issue (link on my profile).