FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
220 views 1 comments
by anonymous
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
by anonymous

Hello,

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,

Žygimantas

by anonymous

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  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0x3f00 /* wan 1 1 */ MARK xset 0x100/0x3f00

0 votes
by anonymous

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
                probability=$(($weight*1000/$total_weight))
                if [ "$probability" -lt 10 ]; then
                        probability="0.00$probability"