OpenWrt Forum Archive

Topic: mwan3; multi-wan policy routing (general topic)

The content of this topic has been archived between 22 May 2013 and 6 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Nice! Your welcome.

For the record: In version 1.5-9 (latest) it is lines 159 and 170.

@Adze: Thank you so much for you help the other week.  Your explanation was very enlightening.  I was able to get a basic failover system working.  Again, thanks.

Is mwan3 capable of dynamic load balancing to ensure a minimum connection speed?  For example, always prefer 100% traffic to wan unless it slows down to much then gradually reroute traffic to wan2 until wan becomes faster, then reroute traffic back to wan.

Hello All! Has somebody successfully operating mwan3(or mwan) and OpenVPN client? I have "Attitude Ajustment" on DIR-600. Please tell about successfull configure mwan3+opnevpn client.

wan is eth0.2 192.170.1.70
tun0 is 10.16.10.10
br-lan (LAN+WLAN0 bridge) 192.168.1.1
wlan0-1 192.168.2.1

I need send traffic from wlan0-1 to tun0 and br-lan to eth0.2. Is it possible?

PS I tried mwan, but I hadn't success

(Last edited by Senya on 8 Jan 2015, 12:28)

ayr0 wrote:

@Adze: Thank you so much for you help the other week.  Your explanation was very enlightening.  I was able to get a basic failover system working.  Again, thanks.

Is mwan3 capable of dynamic load balancing to ensure a minimum connection speed?  For example, always prefer 100% traffic to wan unless it slows down to much then gradually reroute traffic to wan2 until wan becomes faster, then reroute traffic back to wan.

Mwan3 is not designed for this.

Hi - really appreciate your contributions and support.  I was hoping this issue of mine is something simple. hmm

I've dug into one spot where I see an issue during mwan3_set_iface_route:

mwan3_set_iface_route()
{
    $IP route flush table $iface_id
    [ $ACTION == "ifup" ] && $IP route add table $iface_id default $route_args
}

(some logs here to show function arguments for my system)

Thu Jan  8 20:20:48 2015 user.notice mwan3: ifup interface wan (wlan0)
Thu Jan  8 20:20:48 2015 user.notice mwan3: +mwan3_set_iface_iptables -- DEVICE: wlan0, INTERFACE: wan
Thu Jan  8 20:20:48 2015 user.notice mwan3: +mwan3_set_iface_route -- iface_id: 1, route_args: nexthop via 192.168.30.1 dev wlan0
Thu Jan  8 20:20:48 2015 user.notice mwan3: +mwan3_set_iface_rules -- DEVICE: wlan0, INTERFACE: wan

When trying to enter the commands manually, I get:

root@OpenWrt:/# ip -4 route flush table 1
root@OpenWrt:/# ip -4 route add table 1 default nexthop via 192.168.30.1 dev wlan0
RTNETLINK answers: Invalid argument


This causes the entries to not be added in table 1,2 respectively and the mwan3 status call to report an error on each interface.

It would seem that the 'nexthop' argument is causing the issues.  Any ideas?
thanks!


config/network:

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'
        option metric 0

config globals 'globals'
        option ula_prefix 'fd3a:0e88:acc6::/48'

config interface 'lan'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'
        option metric 0

config interface 'wan'
        option proto 'dhcp'
        option metric 10

config interface 'wan2'
        option proto 'dhcp'
        option ifname 'usb0'
        option iface 'usb0'
        option metric 20

(Last edited by cblack on 8 Jan 2015, 21:56)

cblack wrote:

When trying to enter the commands manually, I get:

root@OpenWrt:/# ip -4 route flush table 1
root@OpenWrt:/# ip -4 route add table 1 default nexthop via 192.168.30.1 dev wlan0
RTNETLINK answers: Invalid argument

My first thought is you are missing ipv4 multi path module. I guess the command argument "nexthop" is invalid for your kernel. Did you compile it yourself?

Adze wrote:
cblack wrote:

When trying to enter the commands manually, I get:

root@OpenWrt:/# ip -4 route flush table 1
root@OpenWrt:/# ip -4 route add table 1 default nexthop via 192.168.30.1 dev wlan0
RTNETLINK answers: Invalid argument

My first thought is you are missing ipv4 multi path module. I guess the command argument "nexthop" is invalid for your kernel. Did you compile it yourself?

This was it!

Yes, I am developing support for a new platform which is a (unfortunately custom) 3.10 kernel.

thanks.. seems like it is working OK so far.

If I try to go out through a specific interface, lets just say wan2 using wget bind-address it will bypass mwan3?
I just asking because I'm having some problems to update the dns4me service which uses the source's IP address  that made the connection to update their database.
The IP address that they get it's always the wan1 IP address which by the way is the main connection in mwan3 (metric and weight).
I just want to get the doubt out of my head to look the root cause somewhere else.
Thanks.

(Last edited by joaopaulo.mello on 14 Jan 2015, 01:12)

joaopaulo.mello wrote:

If I try to go out through a specific interface, lets just say wan2 using wget bind-address it will bypass mwan3?
I just asking because I'm having some problems to update the dns4me service which uses the source's IP address  that made the connection to update their database.
The IP address that they get it's always the wan1 IP address which by the way is the main connection in mwan3 (metric and weight).
I just want to get the doubt out of my head to look the root cause somewhere else.
Thanks.

Why not make an mwan3 rule directing your traffic for the dynamic DNS site out the interface you want? Static route works as well.

arfett wrote:
joaopaulo.mello wrote:

If I try to go out through a specific interface, lets just say wan2 using wget bind-address it will bypass mwan3?
I just asking because I'm having some problems to update the dns4me service which uses the source's IP address  that made the connection to update their database.
The IP address that they get it's always the wan1 IP address which by the way is the main connection in mwan3 (metric and weight).
I just want to get the doubt out of my head to look the root cause somewhere else.
Thanks.

Why not make an mwan3 rule directing your traffic for the dynamic DNS site out the interface you want? Static route works as well.

I have 2 records which I have to update, one for each wan uplink, two URL's for the same domain, the only difference is a parameter. AFAIK mwan3 doesn't know about URL's, just IP addresses and ports so it won't work. That's the reason i'm not using the Luci ddns client, because I can't control what wan will be used to fetch the URL, which by the way I'll suggest to the DDNS people.

joaopaulo.mello wrote:
arfett wrote:
joaopaulo.mello wrote:

If I try to go out through a specific interface, lets just say wan2 using wget bind-address it will bypass mwan3?
I just asking because I'm having some problems to update the dns4me service which uses the source's IP address  that made the connection to update their database.
The IP address that they get it's always the wan1 IP address which by the way is the main connection in mwan3 (metric and weight).
I just want to get the doubt out of my head to look the root cause somewhere else.
Thanks.

Why not make an mwan3 rule directing your traffic for the dynamic DNS site out the interface you want? Static route works as well.

I have 2 records which I have to update, one for each wan uplink, two URL's for the same domain, the only difference is a parameter. AFAIK mwan3 doesn't know about URL's, just IP addresses and ports so it won't work. That's the reason i'm not using the Luci ddns client, because I can't control what wan will be used to fetch the URL, which by the way I'll suggest to the DDNS people.

The URL likely resolves to multiple IP addresses. You can simply create two rules for two different IP addresses.

arfett wrote:
joaopaulo.mello wrote:
arfett wrote:

Why not make an mwan3 rule directing your traffic for the dynamic DNS site out the interface you want? Static route works as well.

I have 2 records which I have to update, one for each wan uplink, two URL's for the same domain, the only difference is a parameter. AFAIK mwan3 doesn't know about URL's, just IP addresses and ports so it won't work. That's the reason i'm not using the Luci ddns client, because I can't control what wan will be used to fetch the URL, which by the way I'll suggest to the DDNS people.

The URL likely resolves to multiple IP addresses. You can simply create two rules for two different IP addresses.

If mwan3 just changes the default route my problem is in another place...because I'm explicity telling to wget to use another, I don't see how mwan3 could be get in the way.
Thanks.

I don't remember specifics but setting an interface seemed to work fine for me. Here is a cron example with curl

01 * * * * curl -k http://freedns.afraid.org/dynamic/update.php?hash1 --interface wlan1
02 * * * * curl -k http://freedns.afraid.org/dynamic/update.php?hash2 --interface wlan2
03 * * * * curl -k http://freedns.afraid.org/dynamic/update.php?hash3 --interface wlan3
04 * * * * curl -k http://freedns.afraid.org/dynamic/update.php?hash0
pingo wrote:

I don't remember specifics but setting an interface seemed to work fine for me. Here is a cron example with curl

01 * * * * curl -k http://freedns.afraid.org/dynamic/update.php?hash1 --interface wlan1
02 * * * * curl -k http://freedns.afraid.org/dynamic/update.php?hash2 --interface wlan2
03 * * * * curl -k http://freedns.afraid.org/dynamic/update.php?hash3 --interface wlan3
04 * * * * curl -k http://freedns.afraid.org/dynamic/update.php?hash0

Thanks Pingo, it really works...I was using wget --bind-address, one more time curl surpass wget as usual.
Problem solved.

Adze wrote:

On a second note; it has been said that mwan3 is not compatible with ipv6. Let me clear this up by saying that it is ok to have ipv6 and mwan3 running on the same router. Only ipv6 is ignored by mwan3. Ipv6 routing is done without intervention of any mwan3 rule/route.

To see what would happen, I created an interface wan6_2 with @wan2 for the IPv6 address of wan2. Traceroute6 showed IPv6 traffic from the router correctly load-balanced between wan and wan2, but from a client, IPv6 traffic routed over wan2 is simply lost because the client's interface has an IPv6 address from wan and not from wan2.

Given this, would it be possible for OpenWrt to issue DHCPv6 leases delegated from both wan and wan2 to the same client interface so that mwan3 could load-balance between them?

dgi wrote:
Adze wrote:

On a second note; it has been said that mwan3 is not compatible with ipv6. Let me clear this up by saying that it is ok to have ipv6 and mwan3 running on the same router. Only ipv6 is ignored by mwan3. Ipv6 routing is done without intervention of any mwan3 rule/route.

To see what would happen, I created an interface wan6_2 with @wan2 for the IPv6 address of wan2. Traceroute6 showed IPv6 traffic from the router correctly load-balanced between wan and wan2, but from a client, IPv6 traffic routed over wan2 is simply lost because the client's interface has an IPv6 address from wan and not from wan2.

Given this, would it be possible for OpenWrt to issue DHCPv6 leases delegated from both wan and wan2 to the same client interface so that mwan3 could load-balance between them?

Mwan3 does not load balance ipv6.

Adze wrote:

Mwan3 does not load balance ipv6.

So you say, but traceroute6 from the router was clearly using load-balanced routes. Maybe this accidental partial success can be built upon?

Hi dgi,


It is not as straightforward as you might think. The solution you opted (use dhcpv6 delegation from both wans to lan clients) will not work. You might be able to give lan clients an ipv6 address from both wan ranges, but the decision of which source address to use is then completely out of the hands of the router.

A working solotion could be to only use ipv6 ula address ranges on your lan(s). The router must then nat66 or nptv6 it to the correct wan range. A nice way of doing nat66 or nptv6 is as far as i know still not available in openwrt. But please let me know if i'm wrong.

The reason that load balancing on ipv6 works on your router has absolutely nothing todo with mwan3.

(Last edited by Adze on 24 Jan 2015, 22:28)

There is a question about the verison.
In wiki: http://wiki.openwrt.org/doc/howto/mwan3
OP 14.07 ,the latest version is 1.5-10.
I "Update lists" in OP 14.07, there is only 1.5-9.
How can i update it? Only compile the source code?
Thx very much

I have a configuration with one 3g dongle (eth1) and one tethered phone (usb0).  both are connected properly to internet , and the connection works ok through both.  I want to install mwan3 and load balance them. However everything seems to be ok in the configuration file, but mwan3 status shows under balancede policy only one interface with 100% Currently only 3gwan3 is used. If I changed the order unde balanced policy then 3gwan1 ised.  The connection works ok through internet but using one interface in both cases.  What is wrong?

My configuration is :

Detailed overview :

Interface status:
Interface 3gwan1 is online (tracking active)
Interface 3gwan3 is online (tracking active)

Policy balanced:
3gwan3 (100%)

Policy wan2_only:
3gwan3 (100%)

Policy wan2_wan:
3gwan3 (100%)

Policy wan_only:
3gwan1 (100%)

Policy wan_wan2:
3gwan1 (100%)

Known networks:
destination        policy             hits     
-----------------------------------------------
127.0.0.0/8        default            0       
224.0.0.0/3        default            0       
192.168.9.0/24     default            480     
192.168.42.0/24    default            302     
192.168.105.0/27   default            2       
127.0.0.0          default            0       
127.0.0.0/8        default            0       
127.0.0.1          default            0       
127.255.255.255    default            0       
192.168.9.0        default            0       
192.168.9.100      default            480     
192.168.9.255      default            0       
192.168.42.0       default            0       
192.168.42.154     default            302     
192.168.42.255     default            0       
192.168.105.0      default            0       
192.168.105.14     default            0       
192.168.105.31     default            0       

Active rules:
source             destination        proto  src-port      dest-port     policy          hits     
--------------------------------------------------------------------------------------------------
0.0.0.0/0.0.0.1    0.0.0.0/0          tcp    0:65535       443           wan_wan2        0       
0.0.0.1/0.0.0.1    0.0.0.0/0          tcp    0:65535       443           wan2_wan        0       
0.0.0.0/0          0.0.0.0/0          all                                balanced        783


Software versions :

OpenWrt - OpenWrt Barrier Breaker 14.07
LuCI - 0.12+svn-r10530

mwan3 - 1.5-9
mwan3-luci - 1.3-5

Output of "cat /etc/config/mwan3" :

config interface '3gwan1'
    option enabled '1'
    list track_ip '8.8.4.4'
        list track_ip '8.8.8.8'
        list track_ip '208.67.222.222'
        list track_ip '208.67.220.220'
    option reliability '2'
    option count '1'
    option timeout '2'
    option interval '5'
    option down '3'
    option up '8'

config interface '3gwan3'
    option enabled '1'
        list track_ip '8.8.8.8'
        list track_ip '208.67.220.220'
    option reliability '1'
    option count '1'
    option timeout '2'
    option interval '5'
    option down '3'
    option up '8'

config member 'wan_m1_w3'
    option interface '3gwan1'
    option metric '1'
    option weight '3'

config member 'wan_m2_w3'
    option interface '3gwan1'
    option metric '2'
    option weight '3'

config member 'wan2_m1_w2'
    option interface '3gwan3'
    option metric '1'
    option weight '2'

config member 'wan2_m2_w2'
    option interface '3gwan3'
    option metric '2'
    option weight '2'

config policy 'wan_only'
    list use_member 'wan_m1_w3'

config policy 'wan2_only'
    list use_member 'wan2_m1_w2'

config policy 'balanced'
    list use_member 'wan2_m1_w2'
    list use_member 'wan_m1_w3'

config policy 'wan_wan2'
    list use_member 'wan_m1_w3'
    list use_member 'wan2_m2_w2'

config policy 'wan2_wan'
    list use_member 'wan_m2_w3'
    list use_member 'wan2_m1_w2'

config rule 'sticky_even'
    option src_ip '0.0.0.0/0.0.0.1'
    option dest_port '443'
    option proto 'tcp'
    option use_policy 'wan_wan2'

config rule 'sticky_odd'
    option src_ip '0.0.0.1/0.0.0.1'
    option dest_port '443'
    option proto 'tcp'
    option use_policy 'wan2_wan'

config rule 'default_rule'
    option dest_ip '0.0.0.0/0'
    option use_policy 'balanced'

Output of "cat /etc/config/network" :

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix 'fdec:d62e:c6aa::/48'

config interface 'lan'
    option ifname 'eth0.1'
    option force_link '1'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.105.14'
    option netmask '255.255.255.224'
    option delegate '0'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '0t 1 2 3 4 5'
    option vid '1'

config interface '3gwan1'
    option ifname 'eth1'
    option proto 'dhcp'
    option delegate '0'
    option metric '10'

config interface '3gwan3'
    option proto 'dhcp'
    option ifname 'usb0'
    option delegate '0'
    option metric '20'

Output of "ifconfig" :

br-lan    Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet addr:192.168.105.14  Bcast:192.168.105.31  Mask:255.255.255.224
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18128 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13748 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1429388 (1.3 MiB)  TX bytes:4997182 (4.7 MiB)

eth0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19101 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13844 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1973176 (1.8 MiB)  TX bytes:5058958 (4.8 MiB)
          Interrupt:4

eth0.1    Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19099 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13839 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1629274 (1.5 MiB)  TX bytes:5003084 (4.7 MiB)

eth1      Link encap:Ethernet  XX:XX:XX:XX:XX:XX 
          inet addr:192.168.9.100  Bcast:192.168.9.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3868 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2440 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:636659 (621.7 KiB)  TX bytes:137652 (134.4 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:264 errors:0 dropped:0 overruns:0 frame:0
          TX packets:264 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:24258 (23.6 KiB)  TX bytes:24258 (23.6 KiB)

usb0      Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX 
          inet addr:192.168.42.154  Bcast:192.168.42.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:651 errors:0 dropped:0 overruns:0 frame:0
          TX packets:647 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:25966 (25.3 KiB)  TX bytes:63442 (61.9 KiB)

Output of "route -n" :

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.9.1     0.0.0.0         UG    10     0        0 eth1
0.0.0.0         192.168.42.129  0.0.0.0         UG    20     0        0 usb0
192.168.9.0     0.0.0.0         255.255.255.0   U     10     0        0 eth1
192.168.42.0    0.0.0.0         255.255.255.0   U     20     0        0 usb0
192.168.105.0   0.0.0.0         255.255.255.224 U     0      0        0 br-lan

Output of "ip rule show" :

0:    from all lookup local
1001:    from all iif eth1 lookup main
1002:    from all iif usb0 lookup main
2001:    from all fwmark 0x100/0xff00 lookup 1
2002:    from all fwmark 0x200/0xff00 lookup 2
2253:    from all fwmark 0xfd00/0xff00 blackhole
2254:    from all fwmark 0xfe00/0xff00 unreachable
32766:    from all lookup main
32767:    from all lookup default

Output of "ip route list table 1-250" :

1
default via 192.168.9.1 dev eth1
2
default via 192.168.42.129 dev usb0

Firewall default output policy (must be ACCEPT) :

ACCEPT

Output of "iptables -L -t mangle -v -n" :

Chain PREROUTING (policy ACCEPT 3208 packets, 298K bytes)
pkts bytes target     prot opt in     out     source               destination         
3241  300K mwan3_hook  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
3208  298K fwmark     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain INPUT (policy ACCEPT 2962 packets, 214K bytes)
pkts bytes target     prot opt in     out     source               destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         
    0     0 mssfix     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain OUTPUT (policy ACCEPT 2979 packets, 695K bytes)
pkts bytes target     prot opt in     out     source               destination         
3014  714K mwan3_hook  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
3014  714K mwan3_output_hook  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain POSTROUTING (policy ACCEPT 2979 packets, 695K bytes)
pkts bytes target     prot opt in     out     source               destination         

Chain fwmark (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain mssfix (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 TCPMSS     tcp  --  *      eth1    0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU
    0     0 TCPMSS     tcp  --  *      usb0    0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU

Chain mwan3_connected (2 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  *      *       0.0.0.0/0            127.0.0.0/8          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            224.0.0.0/3          MARK or 0xff00
  576 18432 MARK       all  --  *      *       0.0.0.0/0            192.168.9.0/24       MARK or 0xff00
  361 13356 MARK       all  --  *      *       0.0.0.0/0            192.168.42.0/24      MARK or 0xff00
    4   944 MARK       all  --  *      *       0.0.0.0/0            192.168.105.0/27     MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            127.0.0.0            MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            127.0.0.0/8          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            127.0.0.1            MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            127.255.255.255      MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.9.0          MARK or 0xff00
  576 18432 MARK       all  --  *      *       0.0.0.0/0            192.168.9.100        MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.9.255        MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.42.0         MARK or 0xff00
  361 13356 MARK       all  --  *      *       0.0.0.0/0            192.168.42.154       MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.42.255       MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.105.0        MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.105.14       MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.105.31       MARK or 0xff00

Chain mwan3_hook (2 references)
pkts bytes target     prot opt in     out     source               destination         
6255 1014K CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0            CONNMARK restore mask 0xff00
1193  117K mwan3_ifaces  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
  949 33402 mwan3_connected  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
  944 32406 mwan3_rules  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
6255 1014K CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0            CONNMARK save mask 0xff00
1885 64322 mwan3_connected  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match ! 0xff00/0xff00

Chain mwan3_iface_3gwan1 (1 references)
pkts bytes target     prot opt in     out     source               destination         
  240 83340 MARK       all  --  eth1   *       192.168.9.0/24       0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
    3    96 MARK       all  --  eth1   *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* 3gwan1 */ MARK xset 0x100/0xff00

Chain mwan3_iface_3gwan3 (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  usb0   *       192.168.42.0/24      0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
    1    32 MARK       all  --  usb0   *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* 3gwan3 */ MARK xset 0x200/0xff00

Chain mwan3_ifaces (1 references)
pkts bytes target     prot opt in     out     source               destination         
1193  117K mwan3_iface_3gwan1  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
  945 33254 mwan3_iface_3gwan3  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00

Chain mwan3_output_hook (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain mwan3_policy_balanced (1 references)
pkts bytes target     prot opt in     out     source               destination         
  939 32246 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* 3gwan3 2 2 */ MARK xset 0x200/0xff00

Chain mwan3_policy_wan2_only (0 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* 3gwan3 2 2 */ MARK xset 0x200/0xff00

Chain mwan3_policy_wan2_wan (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* 3gwan3 2 2 */ MARK xset 0x200/0xff00

Chain mwan3_policy_wan_only (0 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* 3gwan1 3 3 */ MARK xset 0x100/0xff00

Chain mwan3_policy_wan_wan2 (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* 3gwan1 3 3 */ MARK xset 0x100/0xff00

Chain mwan3_rules (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 mwan3_policy_wan_wan2  tcp  --  *      *       0.0.0.0/0.0.0.1      0.0.0.0/0            multiport sports 0:65535 multiport dports 443 mark match 0x0/0xff00 /* sticky_even */
    0     0 mwan3_policy_wan2_wan  tcp  --  *      *       0.0.0.1/0.0.0.1      0.0.0.0/0            multiport sports 0:65535 multiport dports 443 mark match 0x0/0xff00 /* sticky_odd */
  939 32246 mwan3_policy_balanced  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* default_rule */

Chain mwan3_track_3gwan1 (0 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  *      *       0.0.0.0/0            208.67.220.220       MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            208.67.222.222       MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            8.8.8.8              MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            8.8.4.4              MARK or 0xff00

Chain mwan3_track_3gwan3 (0 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  *      *       0.0.0.0/0            208.67.220.220       MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            8.8.8.8              MARK or 0xff00

Powered by LuCI Trunk (0.12+svn-r10530) OpenWrt Barrier Breaker 14.07

Hi spon901,

This is obviously not correct. As far as i can tell your config is perfectly fine and both interfaces should be added to mwan3_policy_balanced table. After some thought i think it is a problem with statistics module. Could you please try the following? Does it return an error?

/usr/sbin/iptables -t mangle -A mwan3_policy_balanced -m mark --mark 0x0/0xff00 -m statistic --mode random --probability 0.5 -j MARK --set-xmark 0x200/0xff00

(Last edited by Adze on 28 Jan 2015, 16:00)

I managed to fix it. The problem was that the packages kmod-ipt-ipopt and iptables-mod-ipopt were not installed as a dependency of mwan3 and   there was no error regarding this , the only issue was what I already explained.  After I manually install them, and reboot the router everything seems to be ok.   Thanks, very much for your support.

I get  an error every mwan3 restart:

# mwan3 restart
sh: enabled: unknown operand

This error also bring on every interface event fired by mwan3track, like online/unreachable.

Number of errors is equal to number of intefaces configured on /etc/config/mwan3. So if I have three interfaces it returns:

# mwan3 restart
sh: enabled: unknown operand
sh: enabled: unknown operand
sh: enabled: unknown operand

Debug info:

OpenWrt - OpenWrt Barrier Breaker 14.07
LuCI - 0.12+svn-r10530

mwan3 - 1.5-10
mwan3-luci - 1.3-5

Update mwan3 from 1.5-9 to 1.5-10 didn't fix this error.

Hi noko,


Please take a look at posts #1066 till #1069 in this thread. Maybe this helps?

Thank you. It's truly miniupnpd hotplug script issues.

Actually this string:

if [ ! /etc/init.d/miniupnpd enabled ]

How can I submit a bug report about this package?

(Last edited by noko on 2 Feb 2015, 00:40)