Hello, I'm new to openwrt and I'm enjoying using this due to very good features especially the SQM compared to tomato but I'm having problems on configuring mwan3. I just want to make a simple setup with 2 wans with load balancing and failover but I can't seem to make it work after enabling the mwan3 service, I lose all internet connection even though both wan are up.
Here are the data from troubleshooting tab of mwan3:
Software-Version
-------------------------------------------------
OpenWrt - OpenWrt 18.06.2 r7676-cddd7b4c77
LuCI - git-19.020.41695-6f6641d
Output of "ip a show"
-------------------------------------------------
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet 192.168.19.1/32 scope global lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 80:37:73:cb:b1:22 brd ff:ff:ff:ff:ff:ff
inet6 fe80::8237:73ff:fecb:b122/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 80:37:73:cb:b1:23 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether c2:ad:d4:9d:b6:7c brd ff:ff:ff:ff:ff:ff
6: ifb0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 32
link/ether a2:70:f0:ed:28:c2 brd ff:ff:ff:ff:ff:ff
7: ifb1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 32
link/ether 3a:f5:f7:d6:aa:bc brd ff:ff:ff:ff:ff:ff
9: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 80:37:73:cb:b1:22 brd ff:ff:ff:ff:ff:ff
inet 192.168.19.1/24 brd 192.168.19.255 scope global br-lan
valid_lft forever preferred_lft forever
inet6 fe80::8237:73ff:fecb:b122/64 scope link
valid_lft forever preferred_lft forever
10: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP group default qlen 1000
link/ether 80:37:73:cb:b1:22 brd ff:ff:ff:ff:ff:ff
11: eth0.3@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 80:37:73:cb:b1:22 brd ff:ff:ff:ff:ff:ff
inet 192.168.18.1/24 brd 192.168.18.255 scope global eth0.3
valid_lft forever preferred_lft forever
inet6 fe80::8237:73ff:fecb:b122/64 scope link
valid_lft forever preferred_lft forever
12: eth0.2@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc cake state UP group default qlen 1000
link/ether 80:37:73:cb:b1:22 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.2/24 brd 192.168.1.255 scope global eth0.2
valid_lft forever preferred_lft forever
inet6 fe80::8237:73ff:fecb:b122/64 scope link
valid_lft forever preferred_lft forever
13: eth0.4@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 80:37:73:cb:b1:22 brd ff:ff:ff:ff:ff:ff
inet 112.201.35.244/19 brd 112.201.63.255 scope global eth0.4
valid_lft forever preferred_lft forever
inet6 fe80::8237:73ff:fecb:b122/64 scope link
valid_lft forever preferred_lft forever
21117: ifb4eth0.2: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc cake state UNKNOWN group default qlen 32
link/ether c6:af:c4:fe:ce:48 brd ff:ff:ff:ff:ff:ff
inet6 fe80::c4af:c4ff:fefe:ce48/64 scope link
valid_lft forever preferred_lft forever
Output of "ip route show"
-------------------------------------------------
default via 192.168.19.1 dev lo
default via 192.168.1.1 dev eth0.2 proto static src 192.168.1.2 metric 10
default via 112.201.32.1 dev eth0.4 proto static src 112.201.35.244 metric 20
112.201.32.0/19 dev eth0.4 proto static scope link metric 20
192.168.1.0/24 dev eth0.2 proto static scope link metric 10
192.168.18.0/24 dev eth0.3 proto kernel scope link src 192.168.18.1
192.168.19.0/24 dev br-lan proto kernel scope link src 192.168.19.1
Output of "ip rule show"
-------------------------------------------------
0: from all lookup local
1001: from all iif eth0.2 lookup main
1002: from all iif eth0.4 lookup main
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
32766: from all lookup main
32767: from all lookup default
Output of "ip route list table 1-250"
-------------------------------------------------
Table 1: default via 192.168.1.1 dev eth0.2
Table 2: default via 112.201.32.1 dev eth0.4
Output of "iptables -L -t mangle -v -n"
-------------------------------------------------
Chain PREROUTING (policy ACCEPT 3622 packets, 2180K bytes)
pkts bytes target prot opt in out source destination
4439 2631K mwan3_hook all -- * * 0.0.0.0/0 0.0.0.0/0
Chain INPUT (policy ACCEPT 141 packets, 14383 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 3480 packets, 2165K bytes)
pkts bytes target prot opt in out source destination
22 1837 TCPMSS tcp -- * eth0.2 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 /* !fw3: Zone wan MTU fixing */ TCPMSS clamp to PMTU
14 832 TCPMSS tcp -- * eth0.4 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 /* !fw3: Zone wan2 MTU fixing */ TCPMSS clamp to PMTU
Chain OUTPUT (policy ACCEPT 144 packets, 28412 bytes)
pkts bytes target prot opt in out source destination
225 62838 mwan3_hook all -- * * 0.0.0.0/0 0.0.0.0/0
Chain POSTROUTING (policy ACCEPT 3622 packets, 2193K bytes)
pkts bytes target prot opt in out source destination
Chain mwan3_connected (2 references)
pkts bytes target prot opt in out source destination
2080 1567K MARK all -- * * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_connected dst MARK or 0x3f00
Chain mwan3_hook (2 references)
pkts bytes target prot opt in out source destination
4664 2694K CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK restore mask 0x3f00
253 18037 mwan3_ifaces_in all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
235 17140 mwan3_connected all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
195 14197 mwan3_ifaces_out all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
171 12181 mwan3_rules all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
4664 2694K CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save mask 0x3f00
2402 1598K mwan3_connected 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 -- eth0.2 * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_connected src mark match 0x0/0x3f00 /* default */ MARK or 0x3f00
5 337 MARK all -- eth0.2 * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* wan */ MARK xset 0x100/0x3f00
Chain mwan3_iface_in_wan2 (1 references)
pkts bytes target prot opt in out source destination
0 0 MARK all -- eth0.4 * 0.0.0.0/0 0.0.0.0/0 match-set mwan3_connected src mark match 0x0/0x3f00 /* default */ MARK or 0x3f00
13 560 MARK all -- eth0.4 * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* wan2 */ MARK xset 0x200/0x3f00
Chain mwan3_iface_out_wan (1 references)
pkts bytes target prot opt in out source destination
12 1008 MARK all -- * eth0.2 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* wan */ MARK xset 0x100/0x3f00
Chain mwan3_iface_out_wan2 (1 references)
pkts bytes target prot opt in out source destination
12 1008 MARK all -- * eth0.4 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* wan2 */ MARK xset 0x200/0x3f00
Chain mwan3_ifaces_in (1 references)
pkts bytes target prot opt in out source destination
241 17353 mwan3_iface_in_wan all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
186 13241 mwan3_iface_in_wan2 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
Chain mwan3_ifaces_out (1 references)
pkts bytes target prot opt in out source destination
187 13763 mwan3_iface_out_wan all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
142 10656 mwan3_iface_out_wan2 all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00
Chain mwan3_policy_balanced (1 references)
pkts bytes target prot opt in out source destination
57 3782 MARK all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 statistic mode random probability 0.50000000000 /* wan2 1 2 */ MARK xset 0x200/0x3f00
66 5351 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_1_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/0x3f00 /* wan 1 1 */ MARK xset 0x100/0x3f00
Chain mwan3_policy_wan_2_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/0x3f00 /* wan2 1 1 */ MARK xset 0x200/0x3f00
Chain mwan3_rules (1 references)
pkts bytes target prot opt in out source destination
119 8773 mwan3_policy_balanced all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0x3f00 /* default_rule */
Chain qos_Default (0 references)
pkts bytes target prot opt in out source destination
0 0 CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK restore mask 0xf
0 0 qos_Default_ct all -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf
0 0 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf0 length 0:500 MARK xset 0x22/0xff
0 0 MARK icmp -- * * 0.0.0.0/0 0.0.0.0/0 MARK xset 0x11/0xff
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf0 tcp spts:1024:65535 dpts:1024:65535 MARK xset 0x44/0xff
0 0 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf0 udp spts:1024:65535 dpts:1024:65535 MARK xset 0x44/0xff
0 0 CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save mask 0xff
Chain qos_Default_ct (1 references)
pkts bytes target prot opt in out source destination
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf tcp multiport ports 22,53 /* ssh, dns */ MARK xset 0x11/0xff
0 0 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf udp multiport ports 22,53 /* ssh, dns */ MARK xset 0x11/0xff
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf tcp multiport ports 20,21,25,80,110,443,993,995 /* ftp, smtp, http(s), imap */ MARK xset 0x33/0xff
0 0 MARK tcp -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf tcp multiport ports 5190 /* AOL, iChat, ICQ */ MARK xset 0x22/0xff
0 0 MARK udp -- * * 0.0.0.0/0 0.0.0.0/0 mark match 0x0/0xf udp multiport ports 5190 /* AOL, iChat, ICQ */ MARK xset 0x22/0xff
0 0 CONNMARK all -- * * 0.0.0.0/0 0.0.0.0/0 CONNMARK save mask 0xff
Here is the status from mwan3 (taken from ssh)
root@OpenWrt:~# mwan3 status
Interface status:
interface wan is online and tracking is active
interface wan2 is online and tracking is active
Current ipv4 policies:
balanced:
wan2 (50%)
wan (50%)
wan_1_only:
wan (100%)
wan_2_only:
wan2 (100%)
Current ipv6 policies:
balanced:
unreachable
wan_1_only:
unreachable
wan_2_only:
unreachable
Directly connected ipv4 networks:
192.168.1.0
192.168.1.0/24
192.168.18.255
112.201.32.0
112.201.32.0/19
127.0.0.0
192.168.19.255
192.168.18.0
127.0.0.1
112.201.63.255
224.0.0.0/3
112.201.35.244
192.168.19.1
192.168.19.0
192.168.18.0/24
192.168.18.1
192.168.1.2
192.168.1.255
192.168.19.0/24
127.0.0.0/8
127.255.255.255
Directly connected ipv6 networks:
fe80::/64
Active ipv4 user rules:
3137 268K - balanced all -- * * 0.0.0.0/0 0.0.0.0/0
Active ipv6 user rules:
31 4136 - balanced all * * ::/0 ::/0
I think I configured the wan properly since I can ping both of them from the router by following the guide and configuring it first before installing and starting the mwan3 service. As you can see, the other wan gateway is 192.168.1.1 because this is under CGNAT from my ISP. I don't know if this additional info will help but just ask if you guys need additional info so I can add some more.
By the way, I have no experience in using linux so my knowledge is very limited in using it but if someone can guide me I think I can follow well. Thank you in advance.