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.

noko wrote:

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?

https://github.com/openwrt/packages/issues

hi,all
I have some problems with using mwan3.my mwan3 have upated to the latest version,but not all rules worked.
my mwan3 config:

config rule 'IPv6'
    option dest_ip '216.218.221.6'
    option proto 'all'
    option use_policy 'wan2_only'

config rule 'HOMEServer_IPv6'
    option dest_ip 'tb.ipv6.sparqnet.net'
    option proto 'all'
    option use_policy 'wan3_only'

config rule 'VPS1'
    option proto 'all'
    option use_policy 'wan6_only'
    option dest_ip '106.185.35.124'

config rule 'HDRoad'
    option dest_ip 'hdrote.org'
    option dest_port '80,443'
    option proto 'tcp'
    option use_policy 'wan5_only'

config rule 'm_team'
    option dest_port '80,443'
    option proto 'tcp'
    option use_policy 'wan5_only'
    option dest_ip 'tp.m-team.cc'

config rule 'XiaoMi'
    option proto 'all'
    option use_policy 'xiaomi_lb'
    option src_ip '192.168.1.10,192.168.1.11,192.168.1.244'

config rule 'youku'
    option dest_ip '*.youku.com'
    option proto 'all'
    option use_policy 'xiaomi_lb'

config rule 'iqiyi'
    option dest_ip '*.iqiyi.com'
    option proto 'all'
    option use_policy 'xiaomi_lb'

config rule 'tudou'
    option dest_ip '*.tudou.com'
    option proto 'all'
    option use_policy 'xiaomi_lb'

config rule 'QQ'
    option dest_ip '*.qq.com'
    option proto 'all'
    option use_policy 'wan2_only'

config rule 'DNS'
    option dest_ip '114.114.114.114,114.114.115.115,1.2.4.8'
    option use_policy 'wan11_only'
    option proto 'all'

config rule 'ip138'
    option dest_ip 'ip138.com'
    option proto 'all'
    option use_policy 'wan11_only'

config rule 'WEB'
    option use_policy 'wan11_only'
    option dest_port '22,25,80,110,143,443,465,587,993,995,8000'
    option proto 'tcp'

config rule 'loadbalance'
    option use_policy 'loadbalanced'
    option proto 'all'
    option equalize '1'

config policy 'wan1_only'
    list use_member 'wan1_m1_w2'

config policy 'wan2_only'
    list use_member 'wan2_m1_w2'

config policy 'wan3_only'
    list use_member 'wan3_m1_w2'

config policy 'wan4_only'
    list use_member 'wan4_m1_w2'

config policy 'wan5_only'
    list use_member 'wan5_m1_w2'

config policy 'wan6_only'
    list use_member 'wan6_m1_w2'

config policy 'wan7_only'
    list use_member 'wan7_m1_w2'

config policy 'wan8_only'
    list use_member 'wan8_m1_w2'

config policy 'wan9_only'
    list use_member 'wan9_m1_w2'

config policy 'wan10_only'
    list use_member 'wan10_m1_w2'

config policy 'wan11_only'
    list use_member 'wan11_m1_w1'

config policy 'xiaomi_lb'
    list use_member 'wan7_m1_w2'
    list use_member 'wan8_m1_w2'
    list use_member 'wan9_m1_w2'
    list use_member 'wan10_m1_w2'

config policy 'loadbalanced'
    list use_member 'wan1_m1_w2'
    list use_member 'wan2_m1_w2'
    list use_member 'wan3_m1_w2'
    list use_member 'wan4_m1_w2'
    list use_member 'wan5_m1_w2'
    list use_member 'wan6_m1_w2'
    list use_member 'wan7_m1_w2'
    list use_member 'wan8_m1_w2'
    list use_member 'wan9_m1_w2'
    list use_member 'wan10_m1_w2'

config interface 'wan1'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan2'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan3'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan4'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan5'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan6'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan7'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan8'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan9'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan10'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config interface 'wan11'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '3600'

config member 'wan1_m1_w2'
    option metric '1'
    option interface 'wan1'
    option weight '2'

config member 'wan2_m1_w2'
    option interface 'wan2'
    option metric '1'
    option weight '2'

config member 'wan3_m1_w2'
    option interface 'wan3'
    option metric '1'
    option weight '2'

config member 'wan4_m1_w2'
    option interface 'wan4'
    option metric '1'
    option weight '2'

config member 'wan5_m1_w2'
    option interface 'wan5'
    option metric '1'
    option weight '2'

config member 'wan6_m1_w2'
    option interface 'wan6'
    option metric '1'
    option weight '2'

config member 'wan7_m1_w2'
    option interface 'wan6'
    option metric '1'
    option weight '2'

config member 'wan8_m1_w2'
    option interface 'wan6'
    option metric '1'
    option weight '2'

config member 'wan9_m1_w2'
    option interface 'wan6'
    option metric '1'
    option weight '2'

config member 'wan10_m1_w2'
    option interface 'wan6'
    option metric '1'
    option weight '2'

config member 'wan11_m1_w1'
    option interface 'wan6'
    option metric '1'
    option weight '2'

my network config:

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

config interface 'lan'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option _orig_ifname 'eth0'
    option _orig_bridge 'true'
    option ifname 'eth0 eth1'
    option stp '1'
    option ip6assign '64'

config globals 'globals'
    option ula_prefix '2001:470:fbde:1::/64'

config interface 'wan1'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '1'

config interface 'wan2'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '2'

config interface 'wan3'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '3'

config interface 'wan4'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '4'

config interface 'wan5'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '5'

config interface 'wan6'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '6'

config interface 'wan7'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '7'

config interface 'wan8'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '8'

config interface 'wan9'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '9'

config interface 'wan10'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '10'

config interface 'wan11'
    option proto 'pppoe'
    option ifname 'eth2'
    option username '051915753643'
    option password '963852'
    option metric '11'

config interface 'wan12'
    option proto '6in4'
    option peeraddr '216.218.221.6'
    option ip6addr '2001:470:18:978::2/64'
    option ip6prefix '2001:470:fbde::/48'
    option metric '12'
    option mtu '1480'

eg:I config a rule to get "tcp 22,25,80,110,143,443,465,587,993,995,8000" to "wan11",but it just not work.
   
run "mwan3 status" got this:

root@HOME-Router:~# mwan3 status
Interface status:
Interface wan1 is online (tracking active)
Interface wan2 is online (tracking active)
Interface wan3 is online (tracking active)
Interface wan4 is online (tracking active)
Interface wan5 is online (tracking active)
Interface wan6 is online (tracking active)
Interface wan7 is online (tracking active)
Interface wan8 is online (tracking active)
Interface wan9 is online (tracking active)
Interface wan10 is online (tracking active)
Interface wan11 is online (tracking active)

Policy loadbalanced:
/usr/sbin/mwan3: line 1: arithmetic syntax error

run "mwan3 policies" got this:

/usr/sbin/mwan3: line 212: arithmetic syntax error

run "mwan3 rules" result

root@HOME-Router:~# mwan3 rules
Known networks:
destination        policy             hits     
-----------------------------------------------
127.0.0.0/8        default            515      
224.0.0.0/3        default            549      
112.21.150.1       default            0        
112.21.150.1       default            0        
112.21.153.1       default            0        
114.228.32.1       default            0        
183.213.154.1      default            0        
183.213.154.1      default            0        
192.168.1.0/24     default            7549     
192.168.1.0/24     default            7549     
223.66.36.1        default            0        
223.66.36.1        default            0        
223.66.70.1        default            0        
223.66.70.1        default            0        
223.66.93.1        default            0        
112.21.150.3       default            8342     
112.21.150.249     default            5292     
112.21.153.173     default            1719     
114.228.43.139     default            3315     
127.0.0.0          default            0        
127.0.0.0/8        default            515      
127.0.0.1          default            515      
127.255.255.255    default            0        
183.213.155.163    default            8966     
183.213.155.202    default            1337     
192.168.1.0        default            0        
192.168.1.0        default            0        
192.168.1.1        default            6956     
192.168.1.4        default            0        
192.168.1.255      default            286      
192.168.1.255      default            286      
223.66.37.127      default            120K     
223.66.37.180      default            1705K    
223.66.70.249      default            1498     
223.66.71.145      default            1235     
223.66.93.126      default            607K     

Active rules:
source             destination        proto  src-port      dest-port     policy          hits     
--------------------------------------------------------------------------------------------------
0.0.0.0/0          216.218.221.6      all                                wan2_only       7        
0.0.0.0/0          61.66.254.3        all                                wan3_only       0        
0.0.0.0/0          106.185.35.124     all                                wan6_only       0        
0.0.0.0/0          107.182.170.243    tcp    0:65535       80,443        wan5_only       207      
192.168.1.10       0.0.0.0/0          all                                xiaomi_lb       1124     
192.168.1.11       0.0.0.0/0          all                                xiaomi_lb       0        
192.168.1.244      0.0.0.0/0          all                                xiaomi_lb       0        
0.0.0.0/0          114.114.114.114    all                                wan11_only      6742     
0.0.0.0/0          114.114.115.115    all                                wan11_only      1251     
0.0.0.0/0          1.2.4.8            all                                wan11_only      856      
0.0.0.0/0          211.142.22.26      all                                wan11_only      0        
0.0.0.0/0          211.142.22.25      all                                wan11_only      7        
0.0.0.0/0          211.142.22.24      all                                wan11_only      0        
0.0.0.0/0          0.0.0.0/0          tcp    0:65535       22,25,80,110,143,443,465,587,993,995,8000wan11_only      2558     
0.0.0.0/0          0.0.0.0/0          all                                loadbalanced    7519     

Is there anynoe can figure this out?Thank you.

(Last edited by wacke on 3 Feb 2015, 05:28)

Hi wacke,


Two things strike me. One is an error in your config:

config member 'wan11_m1_w1'
    option interface 'wan6'
    option metric '1'
    option weight '2'

I believe the interface is incorrect. But this does not explain the erros you get when running "mwan3 status" command. I will look into this. Could you please post "iptables -L -t mangle -v -n" outcome? Thank you!

Adze wrote:

Hi wacke,


Two things strike me. One is an error in your config:

config member 'wan11_m1_w1'
    option interface 'wan6'
    option metric '1'
    option weight '2'

I believe the interface is incorrect. But this does not explain the erros you get when running "mwan3 status" command. I will look into this. Could you please post "iptables -L -t mangle -v -n" outcome? Thank you!


Hi,adze
Thank you for your reply,here is the "iptables -L -t mangle -v -n" out put.

root@HOME-Router:~# iptables -L -t mangle -v -n
Chain PREROUTING (policy ACCEPT 13M packets, 13G bytes)
 pkts bytes target     prot opt in     out     source               destination         
  13M   13G mwan3_hook  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  13M   13G fwmark     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain INPUT (policy ACCEPT 145K packets, 17M bytes)
 pkts bytes target     prot opt in     out     source               destination         

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

Chain OUTPUT (policy ACCEPT 209K packets, 46M bytes)
 pkts bytes target     prot opt in     out     source               destination         
 209K   46M mwan3_hook  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 209K   46M mwan3_output_hook  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain POSTROUTING (policy ACCEPT 13M packets, 13G bytes)
 pkts bytes target     prot opt in     out     source               destination                                                                                
7128K 5910M bw_egress  all  --  *      br-lan  0.0.0.0/0            0.0.0.0/0                                                                                  
                                                                                                                                                               
Chain bw_egress (1 references)                                                                                                                                 
 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                                                                                
 1475 87520 TCPMSS     tcp  --  *      pppoe-wan1  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU      
 1324 78836 TCPMSS     tcp  --  *      pppoe-wan2  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU      
 5932  321K TCPMSS     tcp  --  *      pppoe-wan3  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU      
 1357 80588 TCPMSS     tcp  --  *      pppoe-wan4  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU      
 2525  145K TCPMSS     tcp  --  *      pppoe-wan5  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU      
19951 1153K TCPMSS     tcp  --  *      pppoe-wan6  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU      
   86  4156 TCPMSS     tcp  --  *      pppoe-wan7  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU      
   62  2908 TCPMSS     tcp  --  *      pppoe-wan8  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU
   32  1536 TCPMSS     tcp  --  *      pppoe-wan9  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU
   88  4232 TCPMSS     tcp  --  *      pppoe-wan10  0.0.0.0/0            0.0.0.0/0            tcp flags:0x06/0x02 /* wan (mtu_fix) */ TCPMSS clamp to PMTU
   61  2828 TCPMSS     tcp  --  *      pppoe-wan11  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  --  *      6in4-wan12  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         
  756 48289 MARK       all  --  *      *       0.0.0.0/0            127.0.0.0/8          MARK or 0xff00
 1012  247K MARK       all  --  *      *       0.0.0.0/0            224.0.0.0/3          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            112.21.150.1         MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            112.21.150.1         MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            112.21.153.1         MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            114.228.32.1         MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            183.213.154.1        MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            183.213.154.1        MARK or 0xff00
13825 1089K MARK       all  --  *      *       0.0.0.0/0            192.168.1.0/24       MARK or 0xff00
13825 1089K MARK       all  --  *      *       0.0.0.0/0            192.168.1.0/24       MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            223.66.36.1          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            223.66.36.1          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            223.66.70.1          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            223.66.70.1          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            223.66.93.1          MARK or 0xff00
13985 3900K MARK       all  --  *      *       0.0.0.0/0            112.21.150.3         MARK or 0xff00
 9974 5085K MARK       all  --  *      *       0.0.0.0/0            112.21.150.249       MARK or 0xff00
 3035  138K MARK       all  --  *      *       0.0.0.0/0            112.21.153.173       MARK or 0xff00
 5289  231K MARK       all  --  *      *       0.0.0.0/0            114.228.43.139       MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            127.0.0.0            MARK or 0xff00
  756 48289 MARK       all  --  *      *       0.0.0.0/0            127.0.0.0/8          MARK or 0xff00
  756 48289 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
12175 2655K MARK       all  --  *      *       0.0.0.0/0            183.213.155.163      MARK or 0xff00
 2225  102K MARK       all  --  *      *       0.0.0.0/0            183.213.155.202      MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.1.0          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.1.0          MARK or 0xff00
12846  813K MARK       all  --  *      *       0.0.0.0/0            192.168.1.1          MARK or 0xff00
    0     0 MARK       all  --  *      *       0.0.0.0/0            192.168.1.4          MARK or 0xff00
  460 71647 MARK       all  --  *      *       0.0.0.0/0            192.168.1.255        MARK or 0xff00
  460 71647 MARK       all  --  *      *       0.0.0.0/0            192.168.1.255        MARK or 0xff00
 320K  138M MARK       all  --  *      *       0.0.0.0/0            223.66.37.127        MARK or 0xff00
1710K   83M MARK       all  --  *      *       0.0.0.0/0            223.66.37.180        MARK or 0xff00
 2522  111K MARK       all  --  *      *       0.0.0.0/0            223.66.70.249        MARK or 0xff00
 2057 90790 MARK       all  --  *      *       0.0.0.0/0            223.66.71.145        MARK or 0xff00
4722K 5323M MARK       all  --  *      *       0.0.0.0/0            223.66.93.126        MARK or 0xff00

Chain mwan3_hook (2 references)
 pkts bytes target     prot opt in     out     source               destination         
  13M   13G CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0            CONNMARK restore mask 0xff00
99556 6265K mwan3_ifaces  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
50706 3444K mwan3_connected  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
35077 2149K mwan3_rules  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
  13M   13G CONNMARK   all  --  *      *       0.0.0.0/0            0.0.0.0/0            CONNMARK save mask 0xff00
  13M   13G mwan3_connected  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match ! 0xff00/0xff00

Chain mwan3_iface_wan1 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan1 *       112.21.150.1         0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 8081  476K MARK       all  --  pppoe-wan1 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan1 */ MARK xset 0x100/0xff00

Chain mwan3_iface_wan10 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan10 *       112.21.153.1         0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 2792  127K MARK       all  --  pppoe-wan10 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan10 */ MARK xset 0xa00/0xff00

Chain mwan3_iface_wan11 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan11 *       114.228.32.1         0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 5036  220K MARK       all  --  pppoe-wan11 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan11 */ MARK xset 0xb00/0xff00

Chain mwan3_iface_wan2 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan2 *       183.213.154.1        0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 2065 91425 MARK       all  --  pppoe-wan2 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan2 */ MARK xset 0x200/0xff00

Chain mwan3_iface_wan3 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan3 *       223.66.36.1          0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 5998  305K MARK       all  --  pppoe-wan3 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan3 */ MARK xset 0x300/0xff00

Chain mwan3_iface_wan4 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan4 *       112.21.150.1         0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 3201  179K MARK       all  --  pppoe-wan4 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan4 */ MARK xset 0x400/0xff00

Chain mwan3_iface_wan5 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan5 *       223.66.36.1          0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 2589  123K MARK       all  --  pppoe-wan5 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan5 */ MARK xset 0x500/0xff00

Chain mwan3_iface_wan6 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan6 *       223.66.93.1          0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
12688 1014K MARK       all  --  pppoe-wan6 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan6 */ MARK xset 0x600/0xff00

Chain mwan3_iface_wan7 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan7 *       223.66.70.1          0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 2374  104K MARK       all  --  pppoe-wan7 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan7 */ MARK xset 0x700/0xff00

Chain mwan3_iface_wan8 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan8 *       223.66.70.1          0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 1896 83430 MARK       all  --  pppoe-wan8 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan8 */ MARK xset 0x800/0xff00

Chain mwan3_iface_wan9 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 MARK       all  --  pppoe-wan9 *       183.213.154.1        0.0.0.0/0            mark match 0x0/0xff00 /* default */ MARK or 0xff00
 2130 97998 MARK       all  --  pppoe-wan9 *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan9 */ MARK xset 0x900/0xff00

Chain mwan3_ifaces (1 references)
 pkts bytes target     prot opt in     out     source               destination         
99556 6265K mwan3_iface_wan1  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
91397 5784K mwan3_iface_wan2  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
89299 5690K mwan3_iface_wan3  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
83269 5383K mwan3_iface_wan4  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
80033 5201K mwan3_iface_wan5  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
77412 5076K mwan3_iface_wan6  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
64702 4061K mwan3_iface_wan7  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
62301 3954K mwan3_iface_wan8  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
60382 3869K mwan3_iface_wan9  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
58204 3768K mwan3_iface_wan10  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00
55369 3638K mwan3_iface_wan11  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         
  462 14784 mwan3_track_wan1  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  460 14720 mwan3_track_wan2  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  458 14656 mwan3_track_wan3  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  456 14592 mwan3_track_wan4  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  454 14528 mwan3_track_wan5  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  452 14464 mwan3_track_wan6  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  450 14400 mwan3_track_wan7  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  448 14336 mwan3_track_wan8  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  446 14272 mwan3_track_wan9  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  444 14208 mwan3_track_wan10  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32
  442 14144 mwan3_track_wan11  icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 length 32

Chain mwan3_policy_loadbalanced (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 1262 73848 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.10000000009 /* wan6 2 20 */ MARK xset 0x600/0xff00
 1218 73327 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.11100000003 /* wan6 2 18 */ MARK xset 0x600/0xff00
 1244 73578 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.12500000000 /* wan6 2 16 */ MARK xset 0x600/0xff00
 1290 76778 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.14199999999 /* wan6 2 14 */ MARK xset 0x600/0xff00
 1247 73253 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.16600000020 /* wan6 2 12 */ MARK xset 0x600/0xff00
 1269 74373 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.20000000019 /* wan5 2 10 */ MARK xset 0x500/0xff00
 1202 70581 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.25000000000 /* wan4 2 8 */ MARK xset 0x400/0xff00
 1270 74974 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.33300000010 /* wan3 2 6 */ MARK xset 0x300/0xff00
 1239 73471 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.50000000000 /* wan2 2 4 */ MARK xset 0x200/0xff00
 1211 70844 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan1 2 2 */ MARK xset 0x100/0xff00

Chain mwan3_policy_wan10_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 /* wan6 2 2 */ MARK xset 0x600/0xff00

Chain mwan3_policy_wan11_only (7 references)
 pkts bytes target     prot opt in     out     source               destination         
20050 1227K MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan6 2 2 */ MARK xset 0x600/0xff00

Chain mwan3_policy_wan1_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 /* unreachable */ MARK xset 0xfe00/0xff00

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

Chain mwan3_policy_wan3_only (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 /* wan3 2 2 */ MARK xset 0x300/0xff00

Chain mwan3_policy_wan4_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 /* wan4 2 2 */ MARK xset 0x400/0xff00

Chain mwan3_policy_wan5_only (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  313 22811 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan5 2 2 */ MARK xset 0x500/0xff00

Chain mwan3_policy_wan6_only (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 /* wan6 2 2 */ MARK xset 0x600/0xff00

Chain mwan3_policy_wan7_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 /* wan6 2 2 */ MARK xset 0x600/0xff00

Chain mwan3_policy_wan8_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 /* wan6 2 2 */ MARK xset 0x600/0xff00

Chain mwan3_policy_wan9_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 /* wan6 2 2 */ MARK xset 0x600/0xff00

Chain mwan3_policy_xiaomi_lb (3 references)
 pkts bytes target     prot opt in     out     source               destination         
  506 37003 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.25000000000 /* wan6 2 8 */ MARK xset 0x600/0xff00
  517 38104 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.33300000010 /* wan6 2 6 */ MARK xset 0x600/0xff00
  493 37123 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 statistic mode random probability 0.50000000000 /* wan6 2 4 */ MARK xset 0x600/0xff00
  514 34735 MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* wan6 2 2 */ MARK xset 0x600/0xff00

Chain mwan3_rules (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    9   890 mwan3_policy_wan2_only  all  --  *      *       0.0.0.0/0            216.218.221.6        mark match 0x0/0xff00 /* IPv6 */
    0     0 mwan3_policy_wan3_only  all  --  *      *       0.0.0.0/0            61.66.254.3          mark match 0x0/0xff00 /* HOMEServer_IPv6 */
    0     0 mwan3_policy_wan6_only  all  --  *      *       0.0.0.0/0            106.185.35.124       mark match 0x0/0xff00 /* VPS1 */
  313 22811 mwan3_policy_wan5_only  tcp  --  *      *       0.0.0.0/0            107.182.170.243      multiport sports 0:65535 multiport dports 80,443 mark match 0x0/0xff00 /* m_team */
 2030  147K mwan3_policy_xiaomi_lb  all  --  *      *       192.168.1.10         0.0.0.0/0            mark match 0x0/0xff00 /* XiaoMi */
    0     0 mwan3_policy_xiaomi_lb  all  --  *      *       192.168.1.11         0.0.0.0/0            mark match 0x0/0xff00 /* XiaoMi */
    0     0 mwan3_policy_xiaomi_lb  all  --  *      *       192.168.1.244        0.0.0.0/0            mark match 0x0/0xff00 /* XiaoMi */
11902  740K mwan3_policy_wan11_only  all  --  *      *       0.0.0.0/0            114.114.114.114      mark match 0x0/0xff00 /* DNS */
 2008  119K mwan3_policy_wan11_only  all  --  *      *       0.0.0.0/0            114.114.115.115      mark match 0x0/0xff00 /* DNS */
 1819  114K mwan3_policy_wan11_only  all  --  *      *       0.0.0.0/0            1.2.4.8              mark match 0x0/0xff00 /* DNS */
    0     0 mwan3_policy_wan11_only  all  --  *      *       0.0.0.0/0            211.142.22.26        mark match 0x0/0xff00 /* ip138 */
    7   420 mwan3_policy_wan11_only  all  --  *      *       0.0.0.0/0            211.142.22.25        mark match 0x0/0xff00 /* ip138 */
    0     0 mwan3_policy_wan11_only  all  --  *      *       0.0.0.0/0            211.142.22.24        mark match 0x0/0xff00 /* ip138 */
 4314  254K mwan3_policy_wan11_only  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport sports 0:65535 multiport dports 22,25,80,110,143,443,465,587,993,995,8000 mark match 0x0/0xff00 /* WEB */
12452  735K mwan3_policy_loadbalanced  all  --  *      *       0.0.0.0/0            0.0.0.0/0            mark match 0x0/0xff00 /* loadbalance */

Chain mwan3_track_wan1 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  231  7392 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  231  7392 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan10 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  222  7104 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  222  7104 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan11 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  221  7072 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  221  7072 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan2 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  230  7360 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  230  7360 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan3 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  229  7328 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  229  7328 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan4 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  228  7296 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  228  7296 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan5 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  227  7264 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  227  7264 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan6 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  226  7232 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  226  7232 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan7 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  225  7200 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  225  7200 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan8 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  224  7168 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  224  7168 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Chain mwan3_track_wan9 (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  223  7136 MARK       all  --  *      *       0.0.0.0/0            114.114.115.115      MARK or 0xff00
  223  7136 MARK       all  --  *      *       0.0.0.0/0            114.114.114.114      MARK or 0xff00

Hi wacke,


A look at your iptables output suggests that mwan3 is working ok. It's only the status script that has a bug. I will fix this. Thank you for reporting.

If you fix your config (correct all the members with the correct interface) you will be good to go.


Thnx again, Adze.

(Last edited by Adze on 3 Feb 2015, 13:39)

Adze wrote:

Hi wacke,


A look at your iptables output suggests that mwan3 is working ok. It's only the status script that has a bug. I will fix this. Thank you for reporting.

If you fix your config (correct all the members with the correct interface) you will be good to go.


Thnx again, Adze.

After modify the config file,it got back to normal.Thanks a lot!!!

I have an issue. Openwrt Barrier Breaker 14.07/Luci trunk 0.12. Luci-app-mwan3 1.3-5, mwan3 1.5-9, wdr4300. Mwan3 is configured and running. The only issue is that under system, startup the mwan3 is missing. I have tried reinstalling mwan3 several times using the web gui and command line. I did one a while back that had Luci-app-mwan3 1.3-4, mwan3 1.4-24 and it showed up in that one. I had no errors during install. How can I fix this?

What do you mean by "system startup"? Mwan3 is a hotplug event driven script and is not a process. Therefor i recently removed it from /etc/init.d/.

jwajer wrote:

I have an issue. Openwrt Barrier Breaker 14.07/Luci trunk 0.12. Luci-app-mwan3 1.3-5, mwan3 1.5-9, wdr4300. Mwan3 is configured and running. The only issue is that under system, startup the mwan3 is missing. I have tried reinstalling mwan3 several times using the web gui and command line. I did one a while back that had Luci-app-mwan3 1.3-4, mwan3 1.4-24 and it showed up in that one. I had no errors during install. How can I fix this?

It won't show up there. Mwan3 is not a service running in the background and does not and never has run at startup and was never configurable from the startup applications page. Mwan3 is triggered on interface hogplug events. The /etc/init.d/mwan3 is now removed and the misleading entry on the startup page removed.

(Last edited by arfett on 6 Feb 2015, 18:12)

Works as designed. I removed it from the system startup process list somewhere in version 1.5. You can still stop it from the luci-app-mwan3 page or issue "mwan3 stop" at terminal. If you wish that mwan3 does not start when a wan interface comes up, disable all your interfaces in the config.

edit: What Arfett says.. (wasn't paying attention) wink

(Last edited by Adze on 6 Feb 2015, 18:17)

I am new to this and just learning. We used to have a guy who was heavy into this and started us moving from m0n0wall to Openwrt. Unfortunately for us he left and went to another country and now stopped replying to our emails with questions. So now I am trying to get answers on my own. So Thanks to everyone who replied.
Adze... Remember I am new and may ask some stupid questions. When you wrote " You can still stop it from the luci-app-mwan3 page" were you referring to Network then Load Balancing?

jwajer wrote:

When you wrote " You can still stop it from the luci-app-mwan3 page" were you referring to Network then Load Balancing?

If you issue the "mwan3" stop command or (and i maybe mistaken here) push the mwan3 stop button on the webpage, mwan3 will delete all rules and routes created by mwan3. Normal routing will continue, but no load-balancing is done.

(Last edited by Adze on 6 Feb 2015, 18:37)

Hello!
i'm using mwan3 and i have 2 wan: WAN1 and WAN2.
I want WAN2 to be my primary link, if it goes down, test if WAN1 is up and switch to WAN1 if WAN2 comes back online, switch back to WAN2.
But it aIways using WAN1 as primary link. I don't know how to fix it. Can you help me?

(Last edited by phineasmax on 9 Feb 2015, 00:31)

phineasmax wrote:

Hello!
i'm using mwan3 and i have 2 wan: WAN1 and WAN2.
I want WAN2 to be my primary link, if it goes down, test if WAN1 is up and switch to WAN1 if WAN2 comes back online, switch back to WAN2.
But it aIways using WAN1 as primary link. I don't know how to fix it. Can you help me?

http://wiki.openwrt.org/doc/howto/mwan3

wacke wrote:

hi,all
I have some problems with using mwan3.my mwan3 have upated to the latest version,but not all rules worked.
...

my network config:

config interface 'wan1'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '1'

config interface 'wan2'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '2'

config interface 'wan3'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '3'

config interface 'wan4'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '4'

config interface 'wan5'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '5'

config interface 'wan6'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '6'

config interface 'wan7'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '7'

config interface 'wan8'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '8'

config interface 'wan9'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '9'

config interface 'wan10'
    option _orig_ifname 'eth3'
    option _orig_bridge 'true'
    option proto 'pppoe'
    option ifname 'eth3'
    option username '13601508872'
    option password '881025'
    option metric '10'

Hi,

Could you please give more info about your configuration? How is it possible to run a dozen PPPoE WANs over the same interface (eth3) ?

I would have imagined that the way to configure that many WANs would be to define a VLAN for each WAN on OpenWrt, and then trunk all WANs over a single physical interface and finally "expand" the WANs again to individual ports on a managed switch, on which all the ISP modems would be physically connected.

What am I missing here?

TIA.

kpv wrote:

I would have imagined that the way to configure that many WANs would be to define a VLAN for each WAN on OpenWrt, and then trunk all WANs over a single physical interface and finally "expand" the WANs again to individual ports on a managed switch, on which all the ISP modems would be physically connected.

There is technically no problem to have multiple ppp sessions over one physical link. The ISP does exactly that, but then on the other side, termination end-user connections. All the ppp sessions however have the same end points.

(Last edited by Adze on 10 Feb 2015, 19:28)

Adze wrote:
kpv wrote:

I would have imagined that the way to configure that many WANs would be to define a VLAN for each WAN on OpenWrt, and then trunk all WANs over a single physical interface and finally "expand" the WANs again to individual ports on a managed switch, on which all the ISP modems would be physically connected.

There is technically no problem to have multiple ppp sessions over one physical link. The ISP does exactly that, but then on the other side, termination end-user connections. All the ppp sessions however have the same end points.

Let me re-phrase my question:

In the typical xDSL ISP + OpenWrt scenario, we put the ISP modem/router in bridge mode and initiate the PPPoE session from OpenWrt.

How can we do it with e.g. 10 xDSL connections (say 5 from ISP-A and anoher 5 from ISP-B)? AFAIK the easiest way would be to trunk them over a single physical Ethernet port (assuming I don't want to put 10 physical ports on my OpenWrt router) and then expand them with a managed switch, to which the ISP modems would be physically connected.

If you use multiple physical modems, then you indeed need multiple physical interfaces or as you suggested a managed switch and trunk it to your openwrt router. If you use one modem and your ISP allows for multiple concurrent ppp session, then you can use wacke's method.

Hi,adze
Me again,last few days when i use the mwan3,if there is some wans down,and all my internet connection is just down,until all the wans goes up...
my mwan3 config:

config rule 'IPv6'
    option dest_ip '216.218.221.6'
    option proto 'all'
    option use_policy 'wan2_only'

config rule 'HOMEServer_IPv6'
    option dest_ip 'tb.ipv6.sparqnet.net'
    option proto 'all'
    option use_policy 'wan3_only'

config rule 'HDRoad'
    option dest_port '80,443'
    option proto 'tcp'
    option use_policy 'wan5_only'
    option dest_ip 'hdroute.org'

config rule 'm_team'
    option dest_port '80,443'
    option proto 'tcp'
    option use_policy 'wan5_only'
    option dest_ip 'tp.m-team.cc'

config rule 'CCFbits'
    option dest_port '80,443'
    option proto 'tcp'
    option use_policy 'wan5_only'
    option dest_ip 'tracker.ccfbits.org'

config rule 'DNS0'
    option use_policy 'wan1_only'
    option proto 'all'
    option dest_ip '114.114.114.114'

config rule 'DNS1'
    option use_policy 'wan1_only'
    option proto 'all'
    option dest_ip '114.114.115.115'

config rule 'DNS2'
    option use_policy 'wan1_only'
    option proto 'all'
    option dest_ip '1.2.4.8'

config rule 'XiaoMi'
    option proto 'all'
    option use_policy 'xiaomi_lb'
    option src_ip '192.168.1.10,192.168.1.11,192.168.1.244'

config rule 'QQ'
    option dest_ip '*.qq.com'
    option proto 'all'
    option use_policy 'wan2_only'

config rule 'WEB'
    option use_policy 'wan1_only'
    option dest_port '22,25,80,110,143,443,465,587,993,995,8000'
    option proto 'tcp'

config rule 'loadbalance'
    option use_policy 'loadbalanced'
    option proto 'all'
    option equalize '1'

config policy 'wan1_only'
    list use_member 'wan1_m1_w3'

config policy 'wan1_wan2'
    option last_resort 'unreachable'
    list use_member 'wan1_m1_w3'
    list use_member 'wan2_m1_w2'

config policy 'wan2_only'
    list use_member 'wan2_m1_w2'

config policy 'wan3_only'
    list use_member 'wan3_m1_w2'

config policy 'wan4_only'
    list use_member 'wan4_m1_w2'

config policy 'wan5_only'
    list use_member 'wan5_m1_w2'

config policy 'wan6_only'
    list use_member 'wan6_m1_w2'

config policy 'wan7_only'
    list use_member 'wan7_m1_w2'

config policy 'wan8_only'
    list use_member 'wan8_m1_w2'

config policy 'wan9_only'
    list use_member 'wan9_m1_w2'

config policy 'wan10_only'
    list use_member 'wan10_m1_w2'

config policy 'wan11_only'
    list use_member 'wan11_m1_w2'

config policy 'xiaomi_lb'
    list use_member 'wan7_m1_w2'
    list use_member 'wan8_m1_w2'
    list use_member 'wan9_m1_w2'
    list use_member 'wan10_m1_w2'
    list use_member 'wan11_m1_w2'

config policy 'loadbalanced'
    list use_member 'wan2_m1_w2'
    list use_member 'wan3_m1_w2'
    list use_member 'wan4_m1_w2'
    list use_member 'wan5_m1_w2'
    list use_member 'wan6_m1_w2'
    list use_member 'wan7_m1_w2'
    list use_member 'wan8_m1_w2'
    list use_member 'wan9_m1_w2'
    list use_member 'wan10_m1_w2'
    list use_member 'wan11_m1_w2'

config interface 'wan1'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan2'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan3'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan4'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan5'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan6'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan7'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan8'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan9'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan10'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config interface 'wan11'
    option enabled '1'
    option reliability '1'
    option count '1'
    option down '3'
    option up '3'
    option timeout '3'
    list track_ip '114.114.114.114'
    list track_ip '114.114.115.115'
    option interval '600'

config member 'wan1_m1_w3'
    option metric '1'
    option interface 'wan1'
    option weight '3'

config member 'wan2_m1_w2'
    option interface 'wan2'
    option metric '1'
    option weight '2'

config member 'wan3_m1_w2'
    option interface 'wan3'
    option metric '1'
    option weight '2'

config member 'wan4_m1_w2'
    option interface 'wan4'
    option metric '1'
    option weight '2'

config member 'wan5_m1_w2'
    option interface 'wan5'
    option metric '1'
    option weight '2'

config member 'wan6_m1_w2'
    option interface 'wan6'
    option metric '1'
    option weight '2'

config member 'wan7_m1_w2'
    option interface 'wan7'
    option metric '1'
    option weight '2'

config member 'wan8_m1_w2'
    option interface 'wan8'
    option metric '1'
    option weight '2'

config member 'wan9_m1_w2'
    option interface 'wan9'
    option metric '1'
    option weight '2'

config member 'wan10_m1_w2'
    option interface 'wan10'
    option metric '1'
    option weight '2'

config member 'wan11_m1_w2'
    option interface 'wan11'
    option metric '1'
    option weight '2'

and all wans up status:

root@HOME-Router:/etc/config# mwan3 status
Interface status:
Interface wan1 is online (tracking active)
Interface wan2 is online (tracking active)
Interface wan3 is online (tracking active)
Interface wan4 is online (tracking active)
Interface wan5 is online (tracking active)
Interface wan6 is online (tracking active)
Interface wan7 is online (tracking active)
Interface wan8 is online (tracking active)
Interface wan9 is online (tracking active)
Interface wan10 is online (tracking active)
Interface wan11 is online (tracking active)

Policy loadbalanced:
 wan11 (10%)
 wan10 (10%)
 wan9 (10%)
 wan8 (10%)
 wan7 (10%)
 wan6 (10%)
 wan5 (10%)
 wan4 (10%)
 wan3 (10%)
 wan2 (10%)

Policy wan10_only:
 wan10 (100%)

Policy wan11_only:
 wan11 (100%)

Policy wan1_only:
 wan1 (100%)

Policy wan1_wan2:
 wan2 (40%)
 wan1 (60%)

Policy wan2_only:
 wan2 (100%)

Policy wan3_only:
 wan3 (100%)

Policy wan4_only:
 wan4 (100%)

Policy wan5_only:
 wan5 (100%)

Policy wan6_only:
 wan6 (100%)

Policy wan7_only:
 wan7 (100%)

Policy wan8_only:
 wan8 (100%)

Policy wan9_only:
 wan9 (100%)

Policy xiaomi_lb:
 wan11 (20%)
 wan10 (20%)
 wan9 (20%)
 wan8 (20%)
 wan7 (20%)

Known networks:
destination        policy             hits     
-----------------------------------------------
127.0.0.0/8        default            51       
224.0.0.0/3        default            176      
10.7.0.0/24        default            0        
112.1.86.1         default            0        
112.3.84.1         default            0        
112.21.156.1       default            0        
112.21.156.1       default            0        
183.208.176.1      default            0        
183.213.154.1      default            0        
192.168.1.0/24     default            1178     
192.168.100.0/24   default            0        
222.188.197.1      default            0        
223.66.36.1        default            0        
223.66.70.1        default            0        
223.66.93.1        default            0        
223.66.93.1        default            0        
10.7.0.0           default            0        
10.7.0.2           default            0        
10.7.0.255         default            0        
112.1.86.13        default            1064     
112.3.87.164       default            861      
112.21.156.174     default            474      
112.21.156.216     default            393      
127.0.0.0          default            0        
127.0.0.0/8        default            51       
127.0.0.1          default            51       
127.255.255.255    default            0        
183.208.178.14     default            512      
183.213.154.219    default            2218     
192.168.1.0        default            0        
192.168.1.1        default            1087     
192.168.1.255      default            29       
192.168.100.0      default            0        
192.168.100.2      default            0        
192.168.100.255    default            0        
222.188.197.189    default            8036     
223.66.37.224      default            195K     
223.66.70.199      default            979      
223.66.93.152      default            540      
223.66.93.155      default            885      

Active rules:
source             destination        proto  src-port      dest-port     policy          hits     
--------------------------------------------------------------------------------------------------
0.0.0.0/0          216.218.221.6      all                                wan2_only       0        
0.0.0.0/0          104.28.18.105      tcp    0:65535       80,443        wan5_only       4        
0.0.0.0/0          104.28.19.105      tcp    0:65535       80,443        wan5_only       0        
0.0.0.0/0          114.114.114.114    all                                wan1_only       1160     
0.0.0.0/0          114.114.115.115    all                                wan1_only       196      
0.0.0.0/0          1.2.4.8            all                                wan1_only       108      
192.168.1.10       0.0.0.0/0          all                                xiaomi_lb       205      
192.168.1.11       0.0.0.0/0          all                                xiaomi_lb       0        
192.168.1.244      0.0.0.0/0          all                                xiaomi_lb       0        
0.0.0.0/0          0.0.0.0/0          tcp    0:65535       22,25,80,110,143,443,465,587,993,995,8000wan1_only       425      
0.0.0.0/0          0.0.0.0/0          all                                loadbalanced    232 

if there is one wan down,the status

root@HOME-Router:~# mwan3 status
Interface status:
Interface wan1 is online (tracking active)
Interface wan2 is online (tracking active)
Interface wan3 is online (tracking active)
Interface wan4 is online (tracking active)
Interface wan5 is online (tracking active)
Interface wan6 is online (tracking active)
Interface wan7 is online (tracking active)
Interface wan8 is online (tracking active)
Interface wan9 is online (tracking active)
Interface wan10 is online (tracking active)
Interface wan11 is online (tracking active)

Policy loadbalanced:
 wan11 (10%)
 wan10 (10%)
 wan9 (10%)
 wan8 (10%)
 wan7 (10%)
 wan6 (10%)
 wan5 (10%)
 wan4 (10%)
 wan3 (10%)
 wan2 (10%)

Policy wan10_only:
 wan10 (100%)

Policy wan11_only:
 wan11 (100%)

Policy wan1_only:
 wan1 (100%)

Policy wan1_wan2:
 wan2 (40%)
 wan1 (60%)

Policy wan2_only:
 wan2 (100%)

Policy wan3_only:
 wan3 (100%)

Policy wan4_only:
 wan4 (100%)

Policy wan5_only:
 wan5 (100%)

Policy wan6_only:
 wan6 (100%)

Policy wan7_only:
 wan7 (100%)

Policy wan8_only:
 wan8 (100%)

Policy wan9_only:
 wan9 (100%)

Policy xiaomi_lb:
 wan11 (20%)
 wan10 (20%)
 wan9 (20%)
 wan8 (20%)
 wan7 (20%)

Known networks:
destination        policy             hits     
-----------------------------------------------
127.0.0.0/8        default            6        
224.0.0.0/3        default            16       
10.7.0.0/24        default            0        
112.3.84.1         default            0        
112.21.156.1       default            0        
112.21.156.1       default            0        
183.208.176.1      default            0        
183.213.154.1      default            0        
192.168.1.0/24     default            55       
192.168.100.0/24   default            0        
222.188.197.1      default            0        
223.66.36.1        default            0        
223.66.70.1        default            0        
223.66.93.1        default            0        
223.66.93.1        default            0        
10.7.0.0           default            0        
10.7.0.2           default            0        
10.7.0.255         default            0        
112.3.87.164       default            24       
112.21.156.174     default            7        
112.21.156.216     default            6        
127.0.0.0          default            0        
127.0.0.0/8        default            6        
127.0.0.1          default            6        
127.255.255.255    default            0        
183.208.178.14     default            1        
183.213.154.219    default            175      
192.168.1.0        default            0        
192.168.1.1        default            53       
192.168.1.255      default            0        
192.168.100.0      default            0        
192.168.100.2      default            0        
192.168.100.255    default            0        
222.188.197.189    default            57       
223.66.37.224      default            1375     
223.66.70.199      default            24       
223.66.93.152      default            1        
223.66.93.155      default            62       

Active rules:
source             destination        proto  src-port      dest-port     policy          hits     
--------------------------------------------------------------------------------------------------
0.0.0.0/0          216.218.221.6      all                                wan2_only       0 

It seems that mwan3 take a long time (sometimes more than 3 minutes) to get all the rules active,is that normal?

I'm using openwrt x86_64 with my own compiled version(atom525+openwrt latest trunk+x86_64 3.18.6 kernel+eglibc 2.19).

Hi wacke,

Your option interval is set to 600 and option down is set to 3. This results in that when a wan goes down it will take at least 1800 seconds and at most 2400 seconds before failover takes place. In the meantime all traffic is routed over wan interface(s) that don't work. The output you posted shows all interfaces online..

Each interface can take up to 10 sec during mwan3 restart depending on hardware. With 12 wan interfaces i would not be surprised that it took over 2 min.

(Last edited by Adze on 11 Feb 2015, 08:31)

anarchy99 wrote:

I've set 3 l2tp connections mapped to a different VAP/eth interfaces, all seems to work fine except in case when any of the tunnels goes down the traffic that's already been initiated is not blackholed but it continues directly to internet through my ISP connection.

Yes, works as designed. Maybe this is not the best design. I will think about this. Rerouting traffic of an established tcp session to another wan interface is not desirable when e.g. using nat. Sending traffic from an established connection to blackhole is atm considered as rerouting. Maybe you could work around this by creating some firewall rules?

anarchy99 wrote:

Is there a way to make internet access available through my main wan connection only from a specific VAP interface and disabled completely from all other interfaces?

Yes, use firewalling. Mwan3 is not a firewall.

(Last edited by Adze on 11 Feb 2015, 09:08)

Adze wrote:

Hi wacke,

Your option interval is set to 600 and option down is set to 3. This results in that when a wan goes down it will take at least 1800 seconds and at most 2400 seconds before failover takes place. In the meantime all traffic is routed over wan interface(s) that don't work. The output you posted shows all interfaces online..

Each interface can take up to 10 sec during mwan3 restart depending on hardware. With 12 wan interfaces i would not be surprised that it took over 2 min.

Hi Adze,
Thanks for your reply,as i posted mwan3 config,i have a rule that  all the http,https traffic was configured to through wan1,but if there is a wan goes down(not wan1),the http,https rule won't active until the wan goes up(the wan is up but mwan3 still shows down,and take a long time to shows up )...

wacke wrote:

i have a rule that all the http,https traffic was configured to through wan1

I don't see that rule in your output...

Adze wrote:
wacke wrote:

i have a rule that all the http,https traffic was configured to through wan1

I don't see that rule in your output...

config rule 'WEB'
    option use_policy 'wan1_only'
    option dest_port '22,25,80,110,143,443,465,587,993,995,8000'
    option proto 'tcp'
wacke wrote:
Adze wrote:

Hi wacke,

Your option interval is set to 600 and option down is set to 3. This results in that when a wan goes down it will take at least 1800 seconds and at most 2400 seconds before failover takes place. In the meantime all traffic is routed over wan interface(s) that don't work. The output you posted shows all interfaces online..

Each interface can take up to 10 sec during mwan3 restart depending on hardware. With 12 wan interfaces i would not be surprised that it took over 2 min.

Hi Adze,
Thanks for your reply,as i posted mwan3 config,i have a rule that  all the http,https traffic was configured to through wan1,but if there is a wan goes down(not wan1),the http,https rule won't active until the wan goes up(the wan is up but mwan3 still shows down,and take a long time to shows up )...

What would help us is to see the iptables information during the failed state.