OpenWrt Forum Archive

Topic: mwan3; multi-wan policy routing (general topic)

The content of this topic has been archived between 22 May 2013 and 6 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Adze wrote:
shenyz wrote:

Hi,Adze
how long time the new mwan3 ipk for cc can be used?thanks。

It is available: http://213.136.13.52/mwan3_1.5-3_all.ipk


thank you very much,Adze.
and other two ipks ,i can not find it
you said:
Latest release


The mwan3 packages current as of 2014-08-14 are:

• mwan3_1.4-24_all.ipk


• mwan3_1.5-3_all.ipk (OpenWrt CC only)


• luci-app-mwan3_1.3-1_all.ipk

ps:your openwt mwan3 wiki should make change

Download packages


The mwan3 packages aren't in the OpenWrt standard package repository. The two packages need to be separately downloaded and installed.

http://213.136.13.52/mwan3_latest_all.ipk


http://213.136.13.52/luci-app-mwan3_latest_all.ipk

Adze wrote:

http://213.136.13.52/luci-app-mwan3_latest_all.ipk is there and is correct

The latest 1.4 version is indeed still missing as ipk download. You can however build it yourself. Have not done this yet. Will do soon.



I am wait,thank you again

Hello to everyone. I just have updated mwan to 1.4-24 and the transparent proxy (previously working) is broken. Configuration and firewall rules are the same. What info can I provide to investigate further this issue?

privoxy ver.: 3.0.21-2
mwan3 ver.: 1.4-24

Thanks in advance.

Edit: Everything works as expected. Privoxy service accidentally could not start (misconfiguration) which I did not realized, so forget this post.

(Last edited by headless.cross on 28 Aug 2014, 14:00)

HI,

I am just starting to use mwan3, and have an issue I am hoping someone can help with.

I have a simple setup, 2 WAN interfaces.

WAN is set with metric 20
WAN2 is set with metric 10

Both work OK when used individually.

In MWAN config, I have a simple policy that states WAN2 is higher priority then WAN, and all traffic should go out WAN2, unless WAN2 is not available, then traffic should go out WAN.  WAN is always connected, however it may not always have internet access, but MWAN3 does not have to worry about this, just that WAN us "up".

The issue I have is with DNS.

If I try to ping 8.8.8.8, the traffic is correct, however, when I try to ping google.com, it cannot reoslve the name.  This happens when WAN2 is offline, and WAN does not have internet access, and then WAN2 comes back online.  When tis happens, the 8.8.8.8 goes to WAN2, but the DNS seems to be going to WAN, which does not have internet access, and in turn, the DNS fails.....

Any thoughts on why this is happending?

A bit more information:
I run Windows 8, with a linux VM.

From windows, DNS is not working, from Linux, it is.....  Why would windows not behave correctly with the DNS chnage on the router?  Strange.....


And some more info:

When both WAN and WAN2 are "online", /etc/resolv.conf.auto looks like:

# Interface wan
nameserver 10.10.20.1
search lan
# Interface wan2
nameserver 202.3.225.115
nameserver 202.3.225.125

Why are are the DNS lookups not going through the wan2 servers?

Once again, more info:

The nameserver 10.10.20.1 that is listed, is another router, that may, or may not, be connected to the internet.  Right now, I am testing with it not connected to the internet.

It seems that the DNS requests try to go to 10.10.20.1, but I am unsure why the other servers are also not checked, as the 10.10.20.1 DNS lookup will fail.  Why are the other servers not searched also?

If I change the order, and put the 202.X.X.X first in the resolv.conf.auto file, they are searched first, and in turn DNS works OK.

(Last edited by JohnV on 5 Sep 2014, 03:27)

JohnV wrote:

It seems that the DNS requests try to go to 10.10.20.1, but I am unsure why the other servers are also not checked, as the 10.10.20.1 DNS lookup will fail.  Why are the other servers not searched also?

Nameservers in /etc/resolv.conf.auto are queried from top to bottom. Only if a nameserver does not return a response the next nameserver is queried. I think that the nameserver at 10.10.20.1 does respond to a request, even though itself doesn't have internet and thus the answer.

And because 10.10.20.1 is (probably) directly connected to the mwan3 test router it will always be routed there, regardless of wan interface status.

If possible change the DNS settings to Google DNS or OpenDNS.

(Last edited by Adze on 5 Sep 2014, 23:16)

Adze wrote:

Nameservers in /etc/resolv.conf.auto are queried from top to bottom. Only if a nameserver does not return a response the next nameserver is queried. I think that the nameserver at 10.10.20.1 does respond to a request, even though itself doesn't have internet and thus the answer.

And because 10.10.20.1 is (probably) directly connected to the mwan3 test router it will always be routed there, regardless of wan interface status.

If possible change the DNS settings to Google DNS or OpenDNS.


Thanks for the response.

I think you are correct, and came up with a solution.  When WAN2 goes down I change the "peerdns" option on the WAN network to "1".  When WAN2 comes up, I change the "peerdns" option on WAN to "0", eliminating any lookups via WAN.

Hi,
I'm happy mwan3 user on few openwrt routers.
I would have such thing for Debian too.
Did you heard about such thing, maybe?
Is porting possible or rather openwrt specific?

Adze, I've found a typo which made a bug.
If you add some static routes, mwan3 would fail to add them correctly to iptables mangle table.

/etc/hotplug.d/iface/15-mwan3

+ local_net=31.220.43.152
92.42.31.0/24
93.95.98.176
95.215.45.33
+ iptables -S mwan3_iface_wan -t mangle
+ iptables -N mwan3_iface_wan -t mangle
+ iptables -F mwan3_iface_wan -t mangle
+ iptables -D mwan3_ifaces -t mangle -i eth0.2 -m mark --mark 0x0/0xff00 -j mwan3_iface_wan
+ [ ifup == ifup ]
+ [ -n 31.220.43.152
92.42.31.0/24
93.95.98.176
95.215.45.33 ]
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_wan -t mangle -s 31.220.43.152 92.42.31.0/24 93.95.98.176 95.215.45.33 -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 0xff00/0xff00
Bad argument `92.42.31.0/24'
Try `iptables -h' or 'iptables --help' for more information.
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_wan -t mangle -s 31.220.43.152 92.42.31.0/24 93.95.98.176 95.215.45.33 -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 0xff00/0xff00
Bad argument `92.42.31.0/24'
Try `iptables -h' or 'iptables --help' for more information.
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_wan -t mangle -s 31.220.43.152 92.42.31.0/24 93.95.98.176 95.215.45.33 -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 0xff00/0xff00
Bad argument `92.42.31.0/24'
Try `iptables -h' or 'iptables --help' for more information.
+ [ ifup == ifup ]
+ iptables -I mwan3_iface_wan -t mangle -s 31.220.43.152 92.42.31.0/24 93.95.98.176 95.215.45.33 -m mark --mark 0x0/0xff00 -m comment --comment wan -j MARK --set-xmark 0xff00/0xff00
Bad argument `92.42.31.0/24'
Try `iptables -h' or 'iptables --help' for more information

There should be … -t mangle -s $local_nets -m mark … on line 91. Actually, everywhere local_nets should be called local_net and vice versa.

Full log — https://gist.github.com/ValdikSS/78b96927457720fb3802
Troubleshooting data — https://gist.github.com/ValdikSS/1850d8fcbb6a97e1532a

(Last edited by ValdikSS on 8 Sep 2014, 22:02)

Hi ValdikSS,

Thanks for reporting. Will look into this. But why do you want to set these static routes? You could just create a policy for the three statics...

Adze, I don't know actually. Maybe to make static routes work even with mwan3 disabled. Anyway, all static routes seemed working even without fix. I've discovered this error accidentally today.

Hi!
I try to install mwan3 to an TL-WR1043N/ND v1 wich run CC r42139 but i got error when install packages dependencies
Here is my log:

opkg install libc ip iptables iptables-mod-conntrack-extra iptables-mod-ipopt kmod-ipt-conntrack-extra kmod-ipt-ipopt
Package libc (0.9.33.2-1) installed in root is up to date.
Installing ip (3.15.0-1) to root...
Downloading http://downloads.openwrt.org/snapshots/ … r71xx.ipk.
Package iptables (1.4.21-1) installed in root is up to date.
Installing iptables-mod-conntrack-extra (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/snapshots/ … r71xx.ipk.
Installing iptables-mod-ipopt (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/snapshots/ … r71xx.ipk.
Installing kmod-ipt-conntrack-extra (3.10.49-1) to root...
Downloading http://downloads.openwrt.org/snapshots/ … r71xx.ipk.
Installing kmod-ipt-ipopt (3.10.49-1) to root...
Downloading http://downloads.openwrt.org/snapshots/ … r71xx.ipk.
Configuring ip.
Configuring kmod-ipt-conntrack-extra.
Configuring kmod-ipt-ipopt.
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for iptables-mod-conntrack-extra:
*     kernel (= 3.10.49-1-0add8abb8b82fcc886b98fe841166abc) *
* opkg_install_cmd: Cannot install package iptables-mod-conntrack-extra.
* satisfy_dependencies_for: Cannot satisfy the following dependencies for iptables-mod-ipopt:
*     kernel (= 3.10.49-1-0add8abb8b82fcc886b98fe841166abc) *
* opkg_install_cmd: Cannot install package iptables-mod-ipopt.

When i try to install mwan3 everything seem to be ok:

Installing mwan3 (1.5-4) to root...
Downloading http://downloads.openwrt.org/snapshots/ … 4_all.ipk.
Installing iptables-mod-conntrack-extra (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/snapshots/ … r71xx.ipk.
Installing iptables-mod-ipopt (1.4.21-1) to root...
Downloading http://downloads.openwrt.org/snapshots/ … r71xx.ipk.
Configuring iptables-mod-ipopt.
Configuring iptables-mod-conntrack-extra.
Configuring mwan3.

Is this normal?

(Last edited by vlad2005 on 9 Sep 2014, 07:28)

vlad2005 wrote:

* satisfy_dependencies_for: Cannot satisfy the following dependencies for iptables-mod-conntrack-extra:
*     kernel (= 3.10.49-1-0add8abb8b82fcc886b98fe841166abc) *
* satisfy_dependencies_for: Cannot satisfy the following dependencies for iptables-mod-ipopt:
*     kernel (= 3.10.49-1-0add8abb8b82fcc886b98fe841166abc) *

Is this normal?

This usually means you are running trunk and now the package feeds have versions of iptables-mod-conntrack-extra and iptables-mod-ipopt that require a newer Linux kernel than what you have. You normally need to build a new firmware using the latest trunk code that has a newer kernel. It's strange that it installed the dependencies when you installed mwan3 but I would assume it should work if it installed successfully.

(Last edited by arfett on 9 Sep 2014, 22:57)

ValdikSS wrote:

If you add some static routes, mwan3 would fail to add them correctly to iptables mangle table.

Everywhere local_nets should be called local_net and vice versa.

Fixed in version 1.5-5

Adze, thanks!
Would it be packported to v1.4 and is it safe to use 1.5 from trunk with bb rc3?

Hi,

I am using mwan3 since one week and have two problmes, one is similar like JohnV's. I have small network with 3-4 users on wifi and other 5-6 with computers (LAN). LAN and WiFi are bridged (default configuration).  There are two providers wan and wan2 (static and dhcp client).

1. The main problem - when wan is down, mwan3 uses wan2 and traffic is redirected. I have ping from PCs and notebooks to domains and IPs. When try to open some website on PC (WIndows XP) nothing happens, but on laptop (Windows 7) - everything works perfect. I don't thing that the problem is that laptop is connected via WiFi, but will test with LAN cable. I tried with mobile phones through the WiFi when only wan2 was working - everything is OK. In my opinion the problem is with the DNS settings, but I have no idea which. The problem is only with Windows XP for now.

2. The second 'problem' which maybe is a bug - I am using mwan3 only for faulty wan, not load balancing. My priority for wan is '1000' and for wan2 is '1' (the biggest and smallest possible numbers). When wan and wan2 are connected and working, the status is showing 'balanced: wan (99%)   wan2 (0%)'. Is this a bug and is all traffic going through wan? Is there a fix or other settings only for failover without traffic balancing?

Thanks!

uBoTo wrote:

1. The main problem - when wan is down, mwan3 uses wan2 and traffic is redirected. I have ping from PCs and notebooks to domains and IPs. When try to open some website on PC (WIndows XP) nothing happens, but on laptop (Windows 7) - everything works perfect. I don't thing that the problem is that laptop is connected via WiFi, but will test with LAN cable. I tried with mobile phones through the WiFi when only wan2 was working - everything is OK. In my opinion the problem is with the DNS settings, but I have no idea which. The problem is only with Windows XP for now.

Please try it with 8.8.8.8 as dns server on all clients and try again. More info on this in the wiki.

uBoTo wrote:

2. The second 'problem' which maybe is a bug - I am using mwan3 only for faulty wan, not load balancing. My priority for wan is '1000' and for wan2 is '1' (the biggest and smallest possible numbers). When wan and wan2 are connected and working, the status is showing 'balanced: wan (99%)   wan2 (0%)'. Is this a bug and is all traffic going through wan? Is there a fix or other settings only for failover without traffic balancing?

There is no such thing as priority option... You are probably tuning the weight option. With equal metrics, the weight option is used to determine the load each wan gets. This is only valid if the metric is equal. Interfaces with lower metric have precedence over interfaces with higher metric. Please change metric settings, not weight settings. More info on this in the wiki.

(Last edited by Adze on 10 Sep 2014, 16:17)

Hi,

Thanks for the replay. You are right about my second problem (I didn't have access today to the router to see/paste what I've done). I tink that I've really changed the weight option, not the metric. Tomorrow I will make corrections about that and see what will happend.

About my main problem - I tried to enter on one PC manually IP, GW, MASK and DNS (router's IP and 8.8.8.8 for DNS servers), but the problem was not solved. In my /etc/config/interfaces I don't have this option:

JohnV wrote:

I think you are correct, and came up with a solution.  When WAN2 goes down I change the "peerdns" option on the WAN network to "1".  When WAN2 comes up, I change the "peerdns" option on WAN to "0", eliminating any lookups via WAN.

Could it be the problem? The problem is only with PCs in the LAN, which are using WIndowsXP (and maybe one 2003 server, I'm not sure).

uBoTo wrote:

About my main problem - I tried to enter on one PC manually IP, GW, MASK and DNS (router's IP and 8.8.8.8 for DNS servers), but the problem was not solved. In my /etc/config/interfaces I don't have this option:

JohnV wrote:

I think you are correct, and came up with a solution.  When WAN2 goes down I change the "peerdns" option on the WAN network to "1".  When WAN2 comes up, I change the "peerdns" option on WAN to "0", eliminating any lookups via WAN.

Could it be the problem? The problem is only with PCs in the LAN, which are using WIndowsXP (and maybe one 2003 server, I'm not sure).

It should not be a problem, but it's hard to tell from here. Try some more troubleshooting. Maybe paste your troubleshooting output and do a tcpdump? I can take a look at that if you like.

(Last edited by Adze on 10 Sep 2014, 18:54)

Adze, sorry for asking again, but is it safe to install v1.5 on bb rc3?

ValdikSS wrote:

Adze, sorry for asking again, but is it safe to install v1.5 on bb rc3?

Yes, i believe so. You need iptables 1.4-20 or higher for it to work and i believe BB has version 1.4-21.

Hi again! I made some checks (without tcpdump, because I could not install it - no space). The main problem is with opening HTTPS - google, youtube, facebook and websites that use secure http (I tried other sites that don't use https and everything was fine). The second thing - this problem is only with couple PCs. They have ping to google for example, but could not open https://google.com/ ... I am trying to solve this problem whole day and - nothing. I tried different methods to clean dns cache and so on, but with no luck. This happens when I remove the cable from my 'wan' and all the traffic goes through my 'wan2'. When put back the cable and the router redirects the traffic to 'wan' - everything works. Any ideas?

Can you paste the troubleshooting output results please?

uBoTo wrote:

The main problem is with opening HTTPS - google, youtube, facebook and websites that use secure http (I tried other sites that don't use https and everything was fine). The second thing - this problem is only with couple PCs. They have ping to google for example, but could not open https://google.com/ ... I am trying to solve this problem whole day and - nothing. I tried different methods to clean dns cache and so on, but with no luck. This happens when I remove the cable from my 'wan' and all the traffic goes through my 'wan2'. When put back the cable and the router redirects the traffic to 'wan' - everything works. Any ideas?

I think i know what is going on..

The default mwan3 configuration comes with three preconfigured traffic rules. Two of them are for https traffic. The rules are preconfigured in a way that all LAN clients with last octet of it's ip address being even leaving interface wan1 and LAN clients with an ip address with an odd last octet leaving interface wan2. There is probably an error in one of those rules in your setup. That is why some clients do have working https and some clients don't.

(Last edited by Adze on 11 Sep 2014, 21:53)

The problem was really with these rules:

config rule 'sticky_even'
        option src_ip '0.0.0.0/0.0.0.1'
        option dest_port '443'
        option proto 'tcp'
        option use_policy 'wan_wan2'

config rule 'sticky_odd'
        option src_ip '0.0.0.1/0.0.0.1'
        option dest_port '443'
        option proto 'tcp'
        option use_policy 'wan2_wan'

I removed them and everything is now OK. Maybe you should write down in the wiki about "Configuration for failover only".

Sorry, posts 901 to 900 are missing from our archive.