ModemManager: Deprioritizing Route and Supressing DNS

I've got a Sierra Wireless WWAN card under ModemManager that does all that I would expect from it including IPv4, IA-NA, IA-PD†, routes, and carrier DNS.

As this is intended only to be used as a backup when Comcrap fails (regularly), it shouldn't be overriding my DNS and existing routes when it comes up.

Substituting unbound for dnsmasq at least seems to have gotten me past the /etc/resolv.conf problems.

I've still got the loss of my intended default route for IPv4. It looks like the default IPv6 routes are both present in the output of ip -6 route.

Looking at /lib/netifd/proto/modemmanager.sh, I didn't see any obvious way to disable writing carrier-supplied DNS or setting the priority of either the IPv4 or IPv6 routes added.

Short of rewriting the modemmanager.sh proto script, is there a good way to manage these?

(I'd rater not get into the complexity of mwan3, since this is typically an obvious thing -- 50 m tall redwood trees come down in a storm, take out the power lines, and the lights go out.)

† Edit: looking at the logs, it may be OpenWrt that is interpreting the prefix as an IA-PD, rather than one being explicitly granted.

Digging around, there is a "Use gateway metric" field on the advanced tab under LuCI, which is tied to the metric option.

Setting that on the WAN and WWAN interfaces allow the two routes to coexist for IPv4. The metric is the same for IPv4 and IPv6 on WWAN, so the value selected there should be interoperable with the 256/512/1024 default scheme observed in the routing table.

1 Like