ok, I noticed some mess in my configuration:
- there were some
mwan3 specific options in the network config file, I removed them.
- my fallback modem interface (TP-Link M7350), while able to accept an ipv6 from the ISP, doesn't present DHCPv6 to the LAN so it practically doesn't support ipv6. So I don't lose any functionality by excluding ipv6 from mwan3.
- Your explanation of the member naming finally dropped the penny for me so I could make it more consistent and sane
- I follow mwan ipv6 support to remove any mention of ipv6 in mwan3 and use the
option last_resort 'default' in the policies to keep ipv6 routing out of mwan3 (I suspect that your link to the non-standard IPv6 script in your previous reply could be out of date, based on the current mwan3 page?)
What happens now is that:
mwan3 will nicely fall over ipv4 when my primary link drops (I physically pulled the ethernet cable from the WAN modem) and fall back to the primary interface when it comes back online.
- I lost the external ipv6 address. That's something that would be nice to get back as it seems to be a bit more performant.
- The app which tracks external IP's still keeps notifying me about IP address change every minute.
BTW I think that when editing the configuration through the web Luci web interface, it rewrites the mwan3 config file out of order (e.g. config rule default_rule_v4 referencing a config policy failover before it is defined, I reordered the file to address this, does this matter to the software? It definitely makes it easier to eyeball the file when things are in order).
Thank you so much for your help.
Here is my current mwan3:
config globals 'globals'
option mmx_mask '0x3F00'
config interface 'wan'
option enabled '1'
list track_ip '1.0.0.1'
list track_ip '1.1.1.1'
list track_ip '208.67.222.222'
list track_ip '208.67.220.220'
option family 'ipv4'
option reliability '2'
config interface 'wanb'
option enabled '1'
option initial_state 'online'
option family 'ipv4'
list track_ip '8.8.8.8'
option track_method 'ping'
option reliability '1'
option count '1'
option size '56'
option max_ttl '60'
option timeout '4'
option interval '10'
option failure_interval '5'
option recovery_interval '5'
option down '5'
option up '5'
config member 'wan_m10_w1'
option interface 'wan'
option metric '10'
option weight '1'
config member 'wan_m20_w1'
option interface 'wanb'
option metric '20'
option weight '1'
config policy 'wan_only'
list use_member 'wan_m10_w1'
option last_resort 'default'
config policy 'failover'
list use_member 'wan_m10_w1'
list use_member 'wan_m20_w1'
option last_resort 'default'
config rule 'nuc_wan_only'
option proto 'all'
option src_ip '172.16.69.10'
option family 'ipv4'
option sticky '0'
option use_policy 'wan_only'
config rule 'default_rule_v4'
option dest_ip '0.0.0.0/0'
option use_policy 'failover'
option family 'ipv4'
option proto 'all'
option sticky '0'
My current network file:
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd6d:21d6:623a::/48'
option packet_steering '1'
config device
option name 'br-lan'
option type 'bridge'
list ports 'lan1'
list ports 'lan2'
list ports 'lan4'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '172.16.69.1'
option netmask '255.255.255.0'
option ip6assign '60'
config device
option name 'wan'
option macaddr 'A4:13:4E:62:50:b3'
config interface 'wan'
option device 'wan'
option proto 'pppoe'
option username 'username@wba.nbnonline.com.au'
option password 'password'
option ipv6 'auto'
option metric '10'
option peerdns '0'
option family 'ipv4'
list dns '8.8.8.8'
list dns '8.8.4.4'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
option metric '10'
option family 'ipv6'
config device
option type '8021q'
option ifname 'lan3'
option vid '3'
option name 'lan3.3'
config interface 'wanb'
option proto 'dhcp'
option device 'usb0'
option metric '20'
list track_ip '1.0.0.1'
list track_ip '1.1.1.1'
list track_ip '208.67.222.222'
list track_ip '208.67.220.220'
option family 'ipv4'
And the current mwan3 Troubleshooting output:
Software-Version
-------------------------------------------------
OpenWrt - 23.05.5
Output of "ip -4 a show"
-------------------------------------------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
10: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
inet 192.168.0.154/24 brd 192.168.0.255 scope global usb0
valid_lft forever preferred_lft forever
21: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
inet 172.16.69.1/24 brd 172.16.69.255 scope global br-lan
valid_lft forever preferred_lft forever
23: pppoe-wan: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc fq_codel state UNKNOWN group default qlen 3
inet 100.70.250.230 peer 203.134.4.115/32 scope global pppoe-wan
valid_lft forever preferred_lft forever
Output of "ip -4 route show"
-------------------------------------------------
default via 203.134.4.115 dev pppoe-wan proto static metric 10
default via 192.168.0.1 dev usb0 proto static src 192.168.0.154 metric 20
172.16.69.0/24 dev br-lan proto kernel scope link src 172.16.69.1
192.168.0.0/24 dev usb0 proto static scope link metric 20
203.134.4.115 dev pppoe-wan proto kernel scope link src 100.70.250.230
Output of "ip -4 rule show"
-------------------------------------------------
0: from all lookup local
1001: from all iif pppoe-wan lookup 1
1002: from all iif usb0 lookup 2
2001: from all fwmark 0x100/0x3f00 lookup 1
2002: from all fwmark 0x200/0x3f00 lookup 2
2061: from all fwmark 0x3d00/0x3f00 blackhole
2062: from all fwmark 0x3e00/0x3f00 unreachable
3001: from all fwmark 0x100/0x3f00 unreachable
3002: from all fwmark 0x200/0x3f00 unreachable
32766: from all lookup main
32767: from all lookup default
Output of "ip -4 route list table 1-250"
-------------------------------------------------
Routing table 1:
default via 203.134.4.115 dev pppoe-wan proto static metric 10
172.16.69.0/24 dev br-lan proto kernel scope link src 172.16.69.1
203.134.4.115 dev pppoe-wan proto kernel scope link src 100.70.250.230
Routing table 2:
default via 192.168.0.1 dev usb0 proto static src 192.168.0.154 metric 20
172.16.69.0/24 dev br-lan proto kernel scope link src 172.16.69.1
192.168.0.0/24 dev usb0 proto static scope link metric 20
203.134.4.115 dev pppoe-wan proto kernel scope link src 100.70.250.230
Output of "iptables -t mangle -w -L -v -n"
-------------------------------------------------
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
124K 74M mwan3_hook all -- * * 0.0.0.0/0 0.0.0.0/0
Chain INPUT (policy ACCEPT 0 packets, 0 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
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
6162 989K mwan3_hook all -- * * 0.0.0.0/0 0.0.0.0/0
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain mwan3_connected_ipv4 (2 references)
pkts bytes target prot opt in out source destination
42268 22M MARK all -- * * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_connected_ipv4 dst MARK or 0x3f00
Chain mwan3_custom_ipv4 (2 references)
pkts bytes target prot opt in out source destination
0 0 MARK all -- * * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_custom_ipv4 dst MARK or 0x3f00
Chain mwan3_dynamic_ipv4 (2 references)
pkts bytes target prot opt in out source destination
0 0 MARK all -- * * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_dynamic_ipv4 dst MARK or 0x3f00
Chain mwan3_hook (2 references)
pkts bytes target prot opt in out source destination
129K 75M CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 CONNMARK restore mask 0x3f00
6890 1218K mwan3_ifaces_in all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
6668 1184K mwan3_custom_ipv4 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
6668 1184K mwan3_connected_ipv4 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
4377 935K mwan3_dynamic_ipv4 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
4377 935K mwan3_rules all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
130K 75M CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save mask 0x3f00
119K 73M mwan3_custom_ipv4 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match ! 0x3f00/0x3f00
119K 73M mwan3_connected_ipv4 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match ! 0x3f00/0x3f00
79206 51M mwan3_dynamic_ipv4 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match ! 0x3f00/0x3f00
Chain mwan3_iface_in_wan (1 references)
pkts bytes target prot opt in out source destination
0 0 MARK all -- pppoe-wan * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_custom_ipv4 src mark match 0x0/0x3f00 /* default */ MARK or 0x3f00
0 0 MARK all -- pppoe-wan * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_connected_ipv4 src mark match 0x0/0x3f00 /* default */ MARK or 0x3f00
0 0 MARK all -- pppoe-wan * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_dynamic_ipv4 src mark match 0x0/0x3f00 /* default */ MARK or 0x3f00
121 8886 MARK all -- pppoe-wan * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* wan */ MARK xset 0x100/0x3f00
Chain mwan3_iface_in_wanb (1 references)
pkts bytes target prot opt in out source destination
0 0 MARK all -- usb0 * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_custom_ipv4 src mark match 0x0/0x3f00 /* default */ MARK or 0x3f00
40 19524 MARK all -- usb0 * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_connected_ipv4 src mark match 0x0/0x3f00 /* default */ MARK or 0x3f00
0 0 MARK all -- usb0 * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_dynamic_ipv4 src mark match 0x0/0x3f00 /* default */ MARK or 0x3f00
7 571 MARK all -- usb0 * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* wanb */ MARK xset 0x200/0x3f00
Chain mwan3_ifaces_in (1 references)
pkts bytes target prot opt in out source destination
6890 1218K mwan3_iface_in_wan all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
6715 1205K mwan3_iface_in_wanb all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
Chain mwan3_policy_failover (1 references)
pkts bytes target prot opt in out source destination
1329 210K MARK all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* wan 1 1 */ MARK xset 0x100/0x3f00
Chain mwan3_policy_wan_only (1 references)
pkts bytes target prot opt in out source destination
5 362 MARK all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* wan 1 1 */ MARK xset 0x100/0x3f00
Chain mwan3_rules (1 references)
pkts bytes target prot opt in out source destination
19 1884 mwan3_policy_wan_only all -- * * 0.0.0.0 0.0.0.0/0 mark match 0x0/0x3f00
4357 933K mwan3_policy_failover all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00