10135 questions

12113 answers


20364 members

0 votes
40 views 1 comments
I have just updated a RUT240 router to RUT2_R_00.07.01.4 which has mobile failover enabled, but it looks like there is a mistake in the firewall rules causing it load balance the internet traffic instead of run in failover mode.  "iptables -t mangle -L -v -n" shows "mark match 0x0/0x3f00 statistic mode random probability 0.39999999991 /* mob1s1a1 2 5 */ MARK xset 0x200/0x3f00" in both mwan3_policy_balance_default and mwan3_policy_mwan_default.  After running "iptables -t mangle -D mwan3_policy_mwan_default 1" , the internet traffic is correctly going only on the currently active interface.

Edit: Is this random rule meant to be in the mwan3_policy_mwan_default mangle chain or should it only be in mwan3_policy_balance_default ?

2 Answers

0 votes


As of currently, there are no known issues related to load balancing/failover functionalities. Did you perform update with keeping settings from the configuration in previous firmware? 

The rule you mention should only appear in the mwan3_policy_balance_default chain. Is this rule duplicated each time you configure failover?

Best regards,



I just checked on a RUTX11 running firmware RUTX_R_00.07.00 and it doesn't have this problem:

Chain mwan3_policy_mwan_default (1 references)

 pkts bytes target     prot opt in     out     source               destination         

 345K   34M MARK       all  --  *      *              mark match 0x0/0x3f00 /* wan 1 1 */ MARK xset 0x100/0x3f00

0 votes

Here is a patch that fixes the problem:

--- lib/mwan3/mwan3.sh_orig     2022-02-25 19:20:30.000000000 +1000
+++ lib/mwan3/mwan3.sh  2022-05-19 10:09:42.761829191 +1000
@@ -838,7 +838,7 @@
                     -m mark --mark 0x0/$MMX_MASK \
                     -m comment --comment "$iface $weight $weight" \
                     -j MARK --set-xmark $(mwan3_id2mask id MMX_MASK)/$MMX_MASK
-       elif [ $is_offline -eq 0 ]; then
+       elif [ $is_offline -eq 0 -a $policy != 'mwan_default' ]; then
                if [ "$probability" -lt 10 ]; then