Mwan3 broken on current turris release

I used to use mwan3 and recently changed my old USB UMTS stick to a new LTE USB Stick for cellular reception as a failover when wan fails. Then I wanted to change the settings in mwan3 just to find out that mwan3 is completely broken.

The interfaces read as follows:
Interface status:
interface wan is error and tracking is active
interface 3g is unknown and tracking is not enabled

I mean ‘3g’ is ok, but ‘wan’ should be online or offline but not error.

When I try to restart mwan3 I get the following errors:
SQM: Stopping SQM on eth1
SQM: Starting SQM script: piece_of_cake.qos on eth1, in: 185000 Kbps, out: 15000 Kbps
SQM: piece_of_cake.qos was started on eth1 successfully
ip: invalid argument ‘0x3d00/0x3F00’ to ‘fwmark’
ip: invalid argument ‘0x3e00/0x3F00’ to ‘fwmark’
ip: invalid argument ‘0x3d00/0x3F00’ to ‘fwmark’
ip: invalid argument ‘0x3e00/0x3F00’ to ‘fwmark’
ip: invalid argument ‘0x100/0x3F00’ to ‘fwmark’
/sbin/hotplug-call: /etc/hotplug.d/iface/15-mwan3: line 481: network_get_metric: not found

When I try to see the changes in the luci interface it just says “mwan3 is not running” after a while of spinning but ‘ps | grep mwan’ shows me:
6791 root 1212 S /bin/sh /usr/sbin/mwan3track wan eth1 online 178.82.30.225 8.8.4.4 8.8.8.8 208.67.222.222 208.67.220.220
7008 root 1288 S /bin/sh /usr/sbin/mwan3rtmon

So this is also not true.

I’ve seen a topic on openwrt forums having quite similar issues with those ‘invalid argument’ errors here:

But there to solution was to install ip-full which is automatically installed as a dependency when you install mwan3 on turris.

Can someone help out fixing those errors? And very specific why did “ip-full” solve it for standard openwrt but not for turris?

I’m actually out of ideas and would be open for any good solution doing LTE failover, I’m even fine with a completly different solution if there’s an easy one which works on turris omnia.

Thanks for any help on this.

fnord

Dec '18

My mwan3 also broke after the recent updates. It is a simple WAN/WWAN failover. I fixed it by doing the following:

opkg update
opkg remove luci-app-mwan3
opkg remove mwan3
mv /etc/config/mwan3 /root/mwan3
opkg install mwan3 luci-app-mwan3

I then changed the first couple of lines of /lib/mwan3/mwan3.sh to have the full path to ip, ipset and iptables:

IP4="/usr/sbin/ip -4"
IP6="/usr/sbin/ip -6"
IPS="/usr/sbin/ipset"
IPT4="/usr/sbin/iptables -t mangle -w"
IPT6="/usr/sbin/ip6tables -t mangle -w"

After that, I rebuilt my rules in /etc/config/mwan3 (basically, search-replaced all wanb to wwan, set all IPv6 rules to disabled, removed the default http policy and changed the default rule to policy wan_wwan) and then ran /usr/sbin/mwan3 restart - and it worked!

Turns out, with the new update, you need the full path to ip for fwmark to work, and if you don’t have IPv6 rules in your config (which I don’t, since I don’t have IPv6 natively on either of my connections), the rtmon script break everything (and spams the logs with uci errors).

The network_get_metric error is still there, but it does not appear to affect my setup as far as I can tell.

Duplicate thread.