Mwan3 equal cost loadbalancing not working

You should be able to use DHCPv6 as network alias interface. The requirement currently is basically making sure each interface you have is a specific family so WAN would be IPv4 only, WAN6 would be IPv6 only, rather than having both IPv4 and IPv6 on a single interface. Currently mwan3 doesn't handle dual stack interfaces, so splitting them is required, you then also have to configure members and IPv4 and IPv6 policies as per the example configuration. While it is more verbose in terms of network interfaces, alias interfaces will basically apply IPv4 and IPv6 on the single network device i.e. ethX in the end.

Good catch @aaronjg!
@Knogle you have "Obtain IPv6 address" set to automatic in the wan and wanb interfaces, hence the actual ipv6 interfaces are wan_6 and wanb_6. You can either adjust the mwan3 interfaces to these names, or change the setting to manual and use the wan6 and wanb6.

3 Likes

Thanks for your reply. I tried the way, turning Optain IPv6 address to "Manual" Unfortunately wan6 and wanb6 are still disabled in mwan3.

Post your full /etc/config/mwan3 and /etc/config/network if you can with any sensitive info redacted or removed.

1 Like

Thanks for your reply!
Here i got my /etc/config/mwan3

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 'fdfb:9584:eb33::/48'
	option packet_steering '1'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.111.1'

config device 'eth0_2'
	option name 'eth0.2'

config device 'eth0_110'
	option name 'eth0.110'

config interface 'Management'
	option proto 'static'
	option delegate '0'
	option ipaddr '172.20.32.1'
	option netmask '255.255.224.0'
	option ifname 'eth0.110 eth6.110'
	option type 'bridge'
	option stp '1'

config interface 'wan'
	option proto 'pppoe'
	option ifname 'eth5'
	option username 'XXXX'
	option password 'XXXX'
	option metric '1'
	option ipv6 '1'

config interface 'Lab'
	option proto 'static'
	option ipaddr '172.20.64.1'
	option netmask '255.255.224.0'
	option ip6assign '60'
	option ifname 'eth0.2 eth6.2'
	option type 'bridge'
	option stp '1'

config interface 'Trusted'
	option proto 'static'
	option ipaddr '172.20.96.1'
	option netmask '255.255.224.0'
	option ip6assign '60'
	option type 'bridge'
	option stp '1'
	option ifname 'eth0.3 eth6 eth7'

config interface 'VMs'
	option proto 'static'
	option type 'bridge'
	option stp '1'
	option ip6assign '60'
	option ipaddr '192.168.200.1'
	option netmask '255.255.255.0'
	option ifname 'eth0.200 eth6.200'

config interface 'Storage'
	option proto 'static'
	option delegate '0'
	option ipaddr '172.20.160.1'
	option netmask '255.255.224.0'
	option ifname 'eth0.220'

config interface 'Guest'
	option proto 'static'
	option ipaddr '172.20.192.1'
	option netmask '255.255.224.0'
	option ifname 'eth0.320'

config interface 'CCTV'
	option proto 'static'
	option ipaddr '172.20.224.1'
	option netmask '255.255.224.0'
	option delegate '0'
	option ifname 'eth0.340'

config interface 'Printer'
	option ifname 'eth0.4'
	option proto 'static'
	option ipaddr '172.21.0.1'
	option netmask '255.255.224.0'

config interface 'VoIP'
	option proto 'static'
	option ipaddr '172.21.32.1'
	option netmask '255.255.224.0'
	option ifname 'eth0.300'

config interface 'wan6'
	option proto 'dhcpv6'
	option ifname 'eth5'
	option metric '20'
	option reqaddress 'try'
	option reqprefix 'auto'

config interface 'wanb'
	option proto 'pppoe'
	option ifname 'eth4'
	option username 'XXXX'
	option password 'XXXX'
	option metric '2'
	option ipv6 '1'

config interface 'wanb6'
	option proto 'dhcpv6'
	option ifname 'eth4'
	option metric '10'
	option reqaddress 'try'
	option reqprefix 'auto'

And /etc/config/mwan3

Interface status:
 interface wan is online 00h:19m:54s, uptime 00h:20m:05s and tracking is active
 interface wan6 is offline and tracking is paused
 interface wanb is online 00h:19m:49s, uptime 00h:19m:59s and tracking is active
 interface wanb6 is offline and tracking is paused

Current ipv4 policies:
balanced:
 wanb (50%)
 wan (50%)
wan_only:
 wan (100%)
wan_wanb:
 wan (100%)
wanb_only:
 wanb (100%)
wanb_wan:
 wanb (100%)

Current ipv6 policies:
balanced:
 unreachable
wan_only:
 unreachable
wan_wanb:
 unreachable
wanb_only:
 unreachable
wanb_wan:
 unreachable

Directly connected ipv4 networks:
172.20.192.0/19
172.20.224.0/19
78.35.145.32
172.20.64.0/19
172.20.32.0/19
172.21.32.0/19
78.35.146.125
195.14.226.161
172.21.0.0/19
127.0.0.0/8
192.168.200.0/24
172.20.96.0/19
192.168.111.0/24
224.0.0.0/3
172.20.160.0/19

Directly connected ipv6 networks:
fe80::8999:43bd:a711:ec2a
fdfb:9584:eb33::/64
fdfb:9584:eb33:30::/64
fdfb:9584:eb33:10::/64
fe80::/64
fdfb:9584:eb33:20::/64
fe80::200:ff:fe00:0
fe80::a077:727f:4c18:7761

Active ipv4 user rules:
  796 50112 S https  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            multiport dports 443 
 2843  611K - balanced  all  --  *      *       0.0.0.0/0            0.0.0.0/0            

Active ipv6 user rules:
    0     0 S https  tcp      *      *       ::/0                 ::/0                 multiport dports 443 
  565 94421 - balanced  all      *      *       ::/0                 ::/0  

Can you post the actual contents of /etc/config/mwan3 file, that's the configuration file LuCI is writing to, the output you've posted is of mwan3 status, but it won't tell you the interface/policy configuration parts, which I think we are interested in.

1 Like

Ah sorry, my fault. lol.
/etc/config/mwan3


config policy 'balanced'
	list use_member 'wan_m1_w3'
	list use_member 'wanb_m1_w2'
	list use_member 'wan6_m1_w3'
	list use_member 'wanb6_m1_w2'

config policy 'wan_only'
	list use_member 'wan_m1_w3'
	list use_member 'wan6_m1_w3'

config policy 'wanb_only'
	list use_member 'wanb_m1_w2'
	list use_member 'wanb6_m1_w2'

config policy 'wan_wanb'
	list use_member 'wan_m1_w3'
	list use_member 'wanb_m2_w2'
	list use_member 'wan6_m1_w3'
	list use_member 'wanb6_m2_w2'

config policy 'wanb_wan'
	list use_member 'wan_m2_w3'
	list use_member 'wanb_m1_w2'
	list use_member 'wan6_m2_w3'
	list use_member 'wanb6_m1_w2'

config globals 'globals'
	option mmx_mask '0x3F00'
	option rtmon_interval '5'

config interface 'wan'
	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 family 'ipv4'

config interface 'wan6'
	list track_ip '2001:4860:4860::8844'
	list track_ip '2001:4860:4860::8888'
	list track_ip '2620:0:ccd::2'
	list track_ip '2620:0:ccc::2'
	option reliability '2'
	option family 'ipv6'
	option enabled '1'
	option initial_state 'online'
	option track_method 'ping'
	option count '1'
	option size '56'
	option max_ttl '60'
	option check_quality '0'
	option timeout '4'
	option interval '10'
	option failure_interval '5'
	option recovery_interval '5'
	option down '5'
	option up '5'

config interface 'wanb'
	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 '1'
	option family 'ipv4'
	option enabled '1'
	option initial_state 'online'
	option track_method 'ping'
	option count '1'
	option size '56'
	option max_ttl '60'
	option check_quality '0'
	option timeout '4'
	option interval '10'
	option failure_interval '5'
	option recovery_interval '5'
	option down '5'
	option up '5'

config interface 'wanb6'
	list track_ip '2001:4860:4860::8844'
	list track_ip '2001:4860:4860::8888'
	list track_ip '2620:0:ccd::2'
	list track_ip '2620:0:ccc::2'
	option reliability '1'
	option family 'ipv6'
	option enabled '1'
	option initial_state 'online'
	option track_method 'ping'
	option count '1'
	option size '56'
	option max_ttl '60'
	option check_quality '0'
	option timeout '4'
	option interval '10'
	option failure_interval '5'
	option recovery_interval '5'
	option down '5'
	option up '5'

config member 'wan_m1_w3'
	option interface 'wan'
	option metric '1'
	option weight '2'

config member 'wan_m2_w3'
	option interface 'wan'
	option metric '2'
	option weight '2'

config member 'wanb_m1_w2'
	option interface 'wanb'
	option metric '1'
	option weight '2'

config member 'wanb_m2_w2'
	option interface 'wanb'
	option metric '2'
	option weight '2'

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

config member 'wan6_m2_w3'
	option interface 'wan6'
	option metric '2'
	option weight '2'

config member 'wanb6_m1_w2'
	option interface 'wanb6'
	option metric '1'
	option weight '2'

config member 'wanb6_m2_w2'
	option interface 'wanb6'
	option metric '2'
	option weight '2'

config rule 'https'
	option sticky '1'
	option dest_port '443'
	option proto 'tcp'
	option use_policy 'balanced'

config rule 'default_rule_v4'
	option dest_ip '0.0.0.0/0'
	option family 'ipv4'
	option use_policy 'balanced'

config rule 'default_rule_v6'
	option dest_ip '::/0'
	option family 'ipv6'
	option use_policy 'balanced'

Hey friends, problems have been solved.
I've used search and replace for the mwan3 file, in order to replace wan6, and wanb6 by wan_6 and wanb_6. This way worked absolutely fine, and now it's running very well. Also my other dns related topic has been solved because of that. Thanks very much.

1 Like

Ahoy friends.
I'll continue this topic here GMail, Steam downloads and other issues.
Because i think somehow the issue is related to mwan3.
After further testing i'm experiencing issues again with IPv6 at all.
Unfortunately i'm not able to ping IPv6 addresses, but they are being resolved somehow.

I think the issue is not related to mwan3.

ping google.de
PING google.de(fra07s30-in-x2003.1e100.net (2a00:1450:4001:803::2003)) 56 data bytes

Very interesting here in case of traceroute the latency, so seems like the problem is inside of my network, because it doesnt reach anything outside of the network. So i think something inside the network or my OpenWRT device is misconfigured.

The first hop shown below is my WAN Interface.

traceroute to google.de (2a00:1450:4001:803::2003), 30 hops max, 80 byte packets
 1  2001-4dd0-4ed6-10-0-0-0-1.ipv6dyn.netcologne.de (2001:4dd0:4ed6:10::1)  0.276 ms  0.246 ms  0.227 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

There is some "weird" DHCP v6 lease in OpenWRT, i don't know what it is.

Device: "2001-4dd0-4ed6-10-0-0-0-b5e.ipv6dyn.netcologne.de"
With following ip: 2001:4dd0:4ed6:10::b5e
I hope someone could give me some advice in order to check if it's related to mwan3 or something else.
I receive a /48 subnet for my public IPv6 address so that's enough to maintain all the downstream devices.

At least some traffic is being "balanced" somehow, because there are some gigabytes of RX, TX on both wan*6 clients. Don't know where it goes.

IPv6 cannot be exactly balanced. If the client uses a source IP of ISPa, then it must be routed out of ISPa. The same for IP of ISPb. You'd need to use the ULA and do NAT66 in order to make it look like IPv4.

1 Like

Thanks for your help. So in case of IPv6 there is no load balancing at all?
Even with less efficient load balancing it's not a huge problem for me, i'd prefer working IPv6 at all.

Only if your ISPs accept transporting packets using the IP addresses of the other ISP - consumer ISP don't do that (you generally need a rather high tier business contract for that).

1 Like

Both are the same ISP, and same connection bandwidth.

Also another question, is it possible to make any exceptions for some devices? Because Red Dead Redemption on my PS3 is impossible to play because it says i am having connection issues.

@trendy

Do you think it might be necessary to use NAT66 in order to solve the IPv6 issue?

You can make a rule for one device to egress from wan primarily and wanb as failover.

You could disable temporarily IPv6 in PS3 if it is causing such an issue and test.

You can also use the IPv6 prefix from one of the ISPs and remap them using NAT66. Depending on the host, if it only has a ULA and not a global address, it may prefer IPv4 over IPv6.

But either way, something to map the outgoing addresses to be within the prefix of the outgoing interface is necessary.

2 Likes

As aaronjg has said you need to do some form of IPv6 masquerading for it to work in the same way as IPv4. I amended the docs with a specific point around IPv6 support, because out of the box it won't behave the same way as your IPv4 policies.

I use NAT66, there is also NETMAP as another OpenWrt member has posted their setup doing it, but it's extra configuration that mwan3 itself doesn't handle directly.

Thanks very much, i'll try that out. Currently i have massive problems with SIP, i think it doesn't like load balancing, even with IPv4.
How should a rule look like, in order to prevent SIP traffic of being balanced?
Also is there a way to configure QoS for VoIP traffic?
It's very nasty to use VoIP communication without QoS.

Can this guide here provide help in my IPv6 case as well?


At least it's quite simple.
Or do i prefer the one from @aaronjg ?

I got some problem, after removing IPv6 at all from my WAN interfaces, Load Balancing Tab is not showing anything in LuCi, so it's quite dead now. I think i have to use command line now lol, or is there a way to revive the LuCi mwan3 tab again?

The link I posted is @jamesmacwhite's tutorial, which I believe is based on that page.

Not sure what is going on with the LuCI page. You could try restarting your router to see if that recovers things.

Using NAT6 yes, I've also published my config here, if it helps:

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.