MWAN Interface don't change when link back

I have 2 WAN interfaces, configured with metrics 1 and 2. When first link (metric 1) is down, other link upward (metric 2). But when link 1 is back, the traffic continuing outing by link 2.

Is it the http/s traffic which has sticky set on?

It’s default, 600.

I was asking if you notice this behavior with the http(s) traffic only or other types of traffic too.

I only test HTTPs, but I believe this behavior is with all traffic.

I hope that you understand we cannot troubleshoot an issue based on your beliefs, rather than on facts. If http(s) traffic continues using the same gateway it is expected due to stickiness. You should try other protocols, like icmp.

Example:
My WAN1 is down by a interrupting, so my backup is WAN2, but when WAN1 is back on, still going out over WAN2, but not for a few minutes, still going out over WAN2 for HOURS.

It's a fact.

Let's have a look then:
uci export network; uci export mwan3; ip -4 ad; ip -4 ro list table all; ip -4 ru; mwan3 status
Last command should run before and after the wan1 is back online.

I executed now, with my WAN1 UP, but my traffic continuing outing by WAN2.
I only oculted some real IPs.

root@OpenWrt:~# mwan3 status
Interface status:
interface wan1 is online (tracking down)
interface wan2 is online (tracking down)
interface wan3 is online (tracking down)

Policy balanced:
wan3 (50%)
wan1 (50%)

Policy wan1_only:
wan1 (100%)

Policy wan1_wan2:
wan1 (100%)

Policy wan1_wan2_wan3:
wan1 (100%)

Policy wan2_only:
wan2 (100%)

Policy wan2_wan3:
wan3 (60%)
wan2 (40%)

Policy wan3_only:
wan3 (100%)

Known networks:
10.10.10.255
192.168.1.0/24
127.0.0.0/8
192.168.1.0
192.168.1.2
192.168.0.0
192.168.0.0/24
127.255.255.255
192.168.1.255
127.0.0.0
10.10.10.0/24
10.10.10.100
10.10.10.0
192.168.0.255
192.168.0.12
127.0.0.1

Active rules:
2746 226K S dns udp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 53
930 51362 S https tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 443
60 3296 S http tcp -- * * 0.0.0.0/0 0.0.0.0/0 multiport sports 0:65535 multiport dports 80
633 599K - wan1_wan2 all -- * * 0.0.0.0/0 0.0.0.0/0

root@OpenWrt:~# uci export network; uci export mwan3; ip -4 ad; ip -4 ro list table all; ip -4 ru;
package network

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

config interface 'wan2'
option _orig_ifname 'eth1'
option _orig_bridge 'false'
option ifname 'eth1.1'
option proto 'static'
option ipaddr 'X'
option netmask '255.255.255.252'
option broadcast 'X'
option gateway 'X'
option delegate '0'
option metric '20'

config interface 'wan1'
option _orig_ifname 'eth0'
option _orig_bridge 'false'
option ifname 'eth0'
option proto 'static'
option netmask '255.255.255.0'
option gateway '192.168.0.1'
option ipaddr '192.168.0.12'
option metric '10'

config interface 'wan3'
option ifname 'eth1.2'
option _orig_ifname 'eth1.2'
option _orig_bridge 'false'
option proto 'static'
option delegate '0'
option netmask '255.255.255.0'
option ipaddr '192.168.1.2'
option metric '30'
option gateway '192.168.1.1'

config interface 'lan'
option ifname 'eth1.3'
option _orig_ifname 'eth1.3'
option _orig_bridge 'false'
option proto 'static'
option ipaddr '10.10.10.100'
option netmask '255.255.255.0'
option broadcast '10.10.10.255'
option dns '10.10.10.100'
option delegate '0'

config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
option mirror_source_port '0'
option mirror_monitor_port '0'

config switch_vlan
option device 'switch0'
option vlan '1'
option vid '1'
option ports '0t 1'

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

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

package mwan3

config interface 'wan1'
option enabled '1'
option reliability '2'
option count '3'
option timeout '2'
option interval '5'
option down '3'
option up '8'
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'

config interface 'wan2'
list track_ip '8.8.8.8'
list track_ip '208.67.220.220'
option family 'ipv4'
option timeout '2'
option interval '5'
option down '3'
option up '8'
option initial_state 'online'
option track_method 'ping'
option reliability '2'
option size '56'
option check_quality '0'
option failure_interval '5'
option recovery_interval '5'
option flush_conntrack 'never'
option enabled '1'
option count '3'

config interface 'wan3'
option family 'ipv4'
option interval '5'
option down '3'
option up '8'
option enabled '1'
option initial_state 'online'
option track_method 'ping'
option size '56'
option check_quality '0'
option failure_interval '5'
option recovery_interval '5'
option flush_conntrack 'never'
option reliability '2'
option count '5'
option timeout '3'
list track_ip '8.8.8.8'
list track_ip '208.67.220.220'
list track_ip '143.54.1.20'

config policy 'wan1_wan2_wan3'
option last_resort 'default'
list use_member 'wan1_m1_w1'
list use_member 'wan2_m2_w2'
list use_member 'wan3_m3_w3'

config policy 'wan1_wan2'
list use_member 'wan1_m1_w3'
list use_member 'wan2_m2_w2'
option last_resort 'default'

config policy 'wan2_wan3'
list use_member 'wan2_m1_w2'
list use_member 'wan3_m1_w3'
option last_resort 'blackhole'

config policy 'wan1_only'
list use_member 'wan1_m1_w3'
option last_resort 'default'

config policy 'wan2_only'
list use_member 'wan2_m1_w2'
option last_resort 'default'

config policy 'wan3_only'
option last_resort 'default'
list use_member 'wan3_m1_w3'

config policy 'balanced'
option last_resort 'unreachable'
list use_member 'wan1_m1_w3'
list use_member 'wan3_m1_w3'
list use_member 'wan2_m2_w2'

config member 'wan1_m1_w1'
option interface 'wan1'
option metric '1'
option weight '1'

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

config member 'wan1_m2_w3'
option interface 'wan1'
option metric '2'
option weight '3'

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

config member 'wan2_m2_w2'
option interface 'wan2'
option metric '2'
option weight '2'

config member 'wan3_m1_w3'
option interface 'wan3'
option metric '1'
option weight '3'

config member 'wan3_m2_w3'
option interface 'wan3'
option weight '3'
option metric '2'

config member 'wan3_m3_w3'
option interface 'wan3'
option metric '3'
option weight '3'

config rule 'dns'
option dest_port '53'
option sticky '1'
option proto 'udp'
option timeout '10'
option use_policy 'wan1_wan2'

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

config rule 'http'
option dest_port '80'
option proto 'tcp'
option sticky '1'
option use_policy 'wan1_wan2'

config rule 'default_rule'
option dest_ip '0.0.0.0/0'
option proto 'all'
option sticky '0'
option use_policy 'wan1_wan2'

config globals 'globals'
option mmx_mask '0x3F00'
option local_source 'lan'

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
inet 192.168.0.12/24 brd 192.168.0.255 scope global eth0
valid_lft forever preferred_lft forever
8: eth1.3@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
inet 10.10.10.100/24 brd 10.10.10.255 scope global eth1.3
valid_lft forever preferred_lft forever
9: eth1.1@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
inet X/30 brd X scope global eth1.1
valid_lft forever preferred_lft forever
10: eth1.2@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
inet 192.168.1.2/24 brd 192.168.1.255 scope global eth1.2
valid_lft forever preferred_lft forever
default via 192.168.0.1 dev eth0 table 1
default via X dev eth1.1 table 2
default via 192.168.1.1 dev eth1.2 table 3
default via 192.168.0.1 dev eth0 proto static metric 10
default via X dev eth1.1 proto static metric 20
default via 192.168.1.1 dev eth1.2 proto static metric 30
10.10.10.0/24 dev eth1.3 proto kernel scope link src 10.10.10.100
X/30 dev eth1.1 proto static scope link metric 20
192.168.0.0/24 dev eth0 proto static scope link metric 10
192.168.1.0/24 dev eth1.2 proto static scope link metric 30
broadcast 10.10.10.0 dev eth1.3 table local proto kernel scope link src 10.10.10.100
local 10.10.10.100 dev eth1.3 table local proto kernel scope host src 10.10.10.100
broadcast 10.10.10.255 dev eth1.3 table local proto kernel scope link src 10.10.10.100
broadcast 127.0.0.0 dev lo table local proto kernel scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1
broadcast X dev eth1.1 table local proto kernel scope link src X
local X dev eth1.1 table local proto kernel scope host src X
broadcast X dev eth1.1 table local proto kernel scope link src X
broadcast 192.168.0.0 dev eth0 table local proto kernel scope link src 192.168.0.12
local 192.168.0.12 dev eth0 table local proto kernel scope host src 192.168.0.12
broadcast 192.168.0.255 dev eth0 table local proto kernel scope link src 192.168.0.12
broadcast 192.168.1.0 dev eth1.2 table local proto kernel scope link src 192.168.1.2
local 192.168.1.2 dev eth1.2 table local proto kernel scope host src 192.168.1.2
broadcast 192.168.1.255 dev eth1.2 table local proto kernel scope link src 192.168.1.2
0: from all lookup prelocal
1: from all lookup local
1001: from all iif eth0 lookup main
1002: from all iif eth1.1 lookup main
1003: from all iif eth1.2 lookup main
2001: from all fwmark 0x100/0xff00 lookup 1
2002: from all fwmark 0x200/0xff00 lookup 2
2003: from all fwmark 0x300/0xff00 lookup 3
2253: from all fwmark 0xfd00/0xff00 blackhole
2254: from all fwmark 0xfe00/0xff00 unreachable
32766: from all lookup main
32767: from all lookup default

Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik
Please edit your post accordingly. Thank you! :slight_smile:

From a quick look, you should not be using the

in lan interface, as this is the same IP as the interface has.
Other than that, there are some mistakes in the policies, but since you are using everywhere the wan1_wan2 , you are leaving the last_resort option to default, which is wan3.
wan1 interface in mwan3 doesn't have a tracking method. Also you have a value of 8 for option up, which means there have to be 8 successful probes to consider the link up.
Finally do a traceroute 1.1.1.1 or tracert 1.1.1.1 from a lan host.

I migrated to RouterOS.

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