Adze1502 / mwan

Simple policy routing for multiple WANs in OpenWrt
84 stars 24 forks source link

mwan3 2.0-3: No interface recovers from offline if all interfaces became offline #20

Open joaochainho opened 7 years ago

joaochainho commented 7 years ago

Hello, I noticed that no interface recovers from offline if all interfaces became offline. The test scenario if the following: two interfaces (wan and wwan), default policy is wan as primary and wwan as backup.

config interface 'wan'
    option enabled '1'
    list track_ip '8.8.4.4'
    list track_ip '208.67.222.222'
    option reliability '2'
    option count '1'
    option timeout '2'
    option interval '5'
    option down '2'
    option up '5'

config interface 'wwan'
    option enabled '1'
    list track_ip '8.8.8.8'
    list track_ip '208.67.220.220'
    option reliability '1'
    option count '1'
    option timeout '3'
    option interval '5'
    option down '3'
    option up '8'

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

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

config member 'wwan_m1_w2'
    option interface 'wwan'
    option metric '1'
    option weight '2'

config member 'wwan_m2_w2'
    option interface 'wwan'
    option metric '2'
    option weight '2'

config policy 'wan_only'
    list use_member 'wan_m1_w3'

config policy 'wwan_only'
    list use_member 'wwan_m1_w2'

config policy 'balanced'
    list use_member 'wan_m1_w3'
    list use_member 'wwan_m1_w2'

config policy 'wan_wwan'
    list use_member 'wan_m1_w3'
    list use_member 'wwan_m2_w2'

config policy 'wwan_wan'
    list use_member 'wan_m2_w3'
    list use_member 'wwan_m1_w2'

config rule 'default_rule'
    option dest_ip '0.0.0.0/0'
    option use_policy 'wan_wwan'

There is a strange thing: in this state the router sends ARP requests querying the public IP addresses defined as track_ip's.

root@Router1:~# tcpdump -qni eth1 arp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
11:53:49.551576 ARP, Request who-has 208.67.222.222 tell 192.168.100.245, length 28
11:53:50.548220 ARP, Request who-has 0.0.0.0 tell 0.0.0.0, length 28
11:53:51.548217 ARP, Request who-has 208.67.222.222 tell 192.168.100.245, length 28
11:53:56.579945 ARP, Request who-has 0.0.0.0 tell 0.0.0.0, length 28
11:53:57.578211 ARP, Request who-has 208.67.222.222 tell 192.168.100.245, length 28
11:53:58.578210 ARP, Request who-has 208.67.222.222 tell 192.168.100.245, length 28
11:54:03.616117 ARP, Request who-has 208.67.222.222 tell 192.168.100.245, length 28
11:54:04.608211 ARP, Request who-has 208.67.222.222 tell 192.168.100.245, length 28

If I manually run 'ifup wan' then the interface recovers. I noticed this issue for some time. Tested in OpenWrt and LEDE. Glad to provide more info and do further testing if needed.

TIA

joaochainho commented 7 years ago

Version 1.6-3 doesn't have this issue.

Snotmann commented 7 years ago

Could confirm this issue. If both interfaces went down they would not get back online anymore. Seems to be a bug for me !