How Tailscale's Route Table Gets Wiped by mwan3 on OpenWrt
My trusty Netcore N60 Pro runs on OpenWrt 25.12 with both mwan3 and tailscale installed. Tailscale would work fine, then randomly stop being reachable. Every time I touched the mwan3 config, tailscale broke immediately after. Background: routing tables, ip rule, and firewall marks Before the investigation, it's worth untangling three concepts that are easy to conflate: Routing table — Linux…
The article explores the issue of Tailscale's route table getting wiped by mwan3 on OpenWrt. It explains the concepts of routing tables, IP rules, and firewall marks that are relevant to the problem. The investigation begins with incorrect guesses, such as mwan3 deleting something or a faulty nftables compatibility layer, before identifying the root cause.
The problem lies in the way mwan3 flushes routing tables based on the MWAN3\_INTERFACE\_MAX value. Tailscale's table 52 falls within the threshold set by this value, causing it to be wiped on every mwan3 restart. The article then delves into the calculation of this threshold, which is determined by the bit count of the mmx\_mask variable in the mwan3 configuration.
The solution is to adjust the mmx\_mask value to lower the threshold below 52, but even after making this change, the issue persists. Further debugging reveals that the problem lies in the code that flushes tables, which inadvertently wipes Tailscale's table.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.