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.

kpv wrote:

Testing the very latest version of mwan3 1.5-7 on OpenWrt CC r42753, I see the following error:

root@OpenWrt:~# mwan3 ifup wan2
Expecting interface. Usage: mwan3 ifup <interface>
root@OpenWrt:~#

I don't see the same error on the previous version.

Does anyone else see this error when invoking

mwan3 ifup wan2

from the command-line?

PS: Actual mwan3 functionality seems unaffected.

kpv wrote:

Does anyone else see this error when invoking

mwan3 ifup wan2

from the command-line?

PS: Actual mwan3 functionality seems unaffected.

Very bizarre. Can you paste the contents of your ifup() function from /usr/sbin/mwan3 ? The code on github looks good to me and shouldn't be giving you that message.

arfett wrote:
kpv wrote:

Does anyone else see this error when invoking

mwan3 ifup wan2

from the command-line?

PS: Actual mwan3 functionality seems unaffected.

Very bizarre. Can you paste the contents of your ifup() function from /usr/sbin/mwan3 ? The code on github looks good to me and shouldn't be giving you that message.

I think the culprit are the last 2 lines of /usr/sbin/mwan3:

action=${1:-help}
$action
kpv wrote:

Testing the very latest version of mwan3 1.5-7 on OpenWrt CC r42753, I see the following error:

root@OpenWrt:~# mwan3 ifup wan2
Expecting interface. Usage: mwan3 ifup <interface>
root@OpenWrt:~#

I don't see the same error on the previous version.

Does anyone else see this error when invoking

mwan3 ifup wan2

from the command-line?

Yes, my bad. I ntroduced this error in the last version. Will change this later today.

mwan3 won't recover from error - "Timeout waiting for older hotplug processes to finish. ifup interface wan2 (eth2) aborted"

I was "stress-testing" my mwan3 system today and noticed that after both WANs went off-line due to very high ping times, one of them won't recover.

The corresponding mwan3track process has exited.

Mon Oct  6 23:53:12 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Mon Oct  6 23:53:26 2014 user.info mwan3track: Lost 3 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:53:51 2014 user.info mwan3track: Lost 5 ping(s) on interface wan (eth1)
Mon Oct  6 23:53:52 2014 user.info mwan3track: Lost 3 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:54:14 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Mon Oct  6 23:54:14 2014 user.info mwan3track: Lost 2 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:54:44 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Mon Oct  6 23:54:44 2014 user.info mwan3track: Lost 2 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:55:41 2014 user.info mwan3track: Lost 4 ping(s) on interface wan (eth1)
Mon Oct  6 23:55:41 2014 user.info mwan3track: Lost 4 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:56:05 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Mon Oct  6 23:56:06 2014 user.info mwan3track: Lost 2 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:56:18 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Mon Oct  6 23:56:18 2014 user.info mwan3track: Lost 1 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:56:44 2014 user.info mwan3track: Lost 3 ping(s) on interface wan (eth1)
Mon Oct  6 23:56:44 2014 user.info mwan3track: Lost 3 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:57:36 2014 user.info mwan3track: Lost 7 ping(s) on interface wan (eth1)
Mon Oct  6 23:57:36 2014 user.info mwan3track: Lost 6 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:58:15 2014 user.info mwan3track: Lost 5 ping(s) on interface wan (eth1)
Mon Oct  6 23:58:15 2014 user.info mwan3track: Lost 5 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:58:35 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Mon Oct  6 23:58:36 2014 user.info mwan3track: Lost 1 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:58:48 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Mon Oct  6 23:58:49 2014 user.info mwan3track: Lost 1 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:59:18 2014 user.info mwan3track: Lost 1 ping(s) on interface wan2 (eth2)
Mon Oct  6 23:59:23 2014 user.notice mwan3track: Interface wan (eth1) is online
Mon Oct  6 23:59:24 2014 user.notice mwan3: ifup interface wan (eth1)
Mon Oct  6 23:59:25 2014 user.notice mwan3track: Interface wan2 (eth2) is online
Tue Oct  7 00:00:27 2014 user.warn mwan3: Timeout waiting for older hotplug processes to finish. ifup interface wan2 (eth2) aborted
Tue Oct  7 00:00:56 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Tue Oct  7 00:03:34 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Tue Oct  7 00:07:53 2014 user.info mwan3track: Lost 5 ping(s) on interface wan (eth1)
Tue Oct  7 00:08:32 2014 user.info mwan3track: Lost 3 ping(s) on interface wan (eth1)
Tue Oct  7 00:09:24 2014 user.info mwan3track: Lost 5 ping(s) on interface wan (eth1)
Tue Oct  7 00:10:12 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Tue Oct  7 00:11:01 2014 user.notice mwan3track: Interface wan (eth1) is offline
Tue Oct  7 00:11:01 2014 user.notice mwan3: ifdown interface wan (eth1)
Tue Oct  7 00:11:54 2014 user.info mwan3track: Lost 13 ping(s) on interface wan (eth1)
Tue Oct  7 00:12:04 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Tue Oct  7 00:12:58 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Tue Oct  7 00:12:58 2014 user.notice mwan3track: Interface wan (eth1) is online
Tue Oct  7 00:12:59 2014 user.notice mwan3: ifup interface wan (eth1)
Tue Oct  7 00:18:43 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Tue Oct  7 00:20:43 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Tue Oct  7 00:22:06 2014 user.notice mwan3track: Interface wan (eth1) is offline
Tue Oct  7 00:22:06 2014 user.notice mwan3: ifdown interface wan (eth1)
Tue Oct  7 00:22:18 2014 user.info mwan3track: Lost 6 ping(s) on interface wan (eth1)
Tue Oct  7 00:23:04 2014 user.info mwan3track: Lost 4 ping(s) on interface wan (eth1)
Tue Oct  7 00:23:35 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Tue Oct  7 00:24:21 2014 user.info mwan3track: Lost 6 ping(s) on interface wan (eth1)
Tue Oct  7 00:24:44 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Tue Oct  7 00:25:10 2014 user.info mwan3track: Lost 3 ping(s) on interface wan (eth1)
Tue Oct  7 00:25:48 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Tue Oct  7 00:26:20 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Tue Oct  7 00:27:16 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Tue Oct  7 00:27:28 2014 user.info mwan3track: Lost 1 ping(s) on interface wan (eth1)
Tue Oct  7 00:27:28 2014 user.notice mwan3track: Interface wan (eth1) is online
Tue Oct  7 00:27:29 2014 user.notice mwan3: ifup interface wan (eth1)
Tue Oct  7 00:27:51 2014 user.info mwan3track: Lost 3 ping(s) on interface wan (eth1)
Tue Oct  7 00:28:32 2014 user.info mwan3track: Lost 2 ping(s) on interface wan (eth1)
Tue Oct  7 00:29:41 2014 user.info mwan3track: Lost 5 ping(s) on interface wan (eth1)
root@OpenWrt:~# mwan3 status
Interface status:
Interface wan is online (tracking active)
Interface wan2 is offline (tracking down)

Policy balanced:
 wan (100%)

Policy wan2_only:
 unreachable

Policy wan2_wan:
 wan (100%)

Policy wan_only:
 wan (100%)

Policy wan_wan2:
 wan (100%)
...

We have mwan3 working amongst other things on our firmware:

Scroll down till you hit "MultiWeb" yes we have named our revisions after spiders smile

http://ofmodemsandmen.com/downloads.html

Here is a Tutorial Dairyman has developed:

http://ofmodemsandmen.com/multiweb.html

This firmware is good for many routers and also allows for 3G and 4G modems even in a 3G router and also has SMS + cell signal information.

The website is a bit dated.
Currently i am working on a new Luci theme.

(Last edited by Straitvodka on 7 Oct 2014, 11:32)

Straitvodka wrote:

Here is a Tutorial Dairyman has developed:

http://ofmodemsandmen.com/multiweb.html

I'm not sure if near the end this part is correct:

"The Manager is only in operation if two modems are present. Otherwise normal routing takes place."

Unless there are rooter scripts to make that a reality then MWAN3 is very much in charge of traffic regardless of how many interfaces are online/present.

I use MWAN3 at home most of the time with a single WAN interface unless I'm directing traffic out one of the many cracked WiFi networks in my neighborhood for testing MWAN3 from home.

(Last edited by arfett on 17 Oct 2014, 00:45)

Just downloaded latest version to test,
mwan3 - 1.5-8
mwan3-luci - 1.3-5



Scenario, wan is down (physically disconnected), wan2 is connected.

Why does Policy wan_wan2 (which is simply a priority to wan over wan2), show unreachable.  Should it not say wan2 (100%)?



I am seeing the following:

Interface status:
Interface wan is offline
Interface wan2 is online

Policy wan2_only:
wan2 (100%)

Policy wan2_wan:
wan2 (100%)

Policy wan_only:
unreachable

Policy wan_wan2:
unreachable

Known networks:
destination        policy             hits     
-----------------------------------------------
127.0.0.0/8        default            8       
224.0.0.0/3        default            45       
10.10.10.0/24      default            99       
10.64.64.64        default            0       

Active rules:
source             destination        proto  src-port      dest-port     policy          hits     
--------------------------------------------------------------------------------------------------
0.0.0.0/0          0.0.0.0/0          all                                wan2_wan        330

JohnV wrote:

Scenario, wan is down (physically disconnected), wan2 is connected.

Why does Policy wan_wan2 (which is simply a priority to wan over wan2), show unreachable.  Should it not say wan2 (100%)?

Yes it should. Could you paste your mwan3 config please?

Adze wrote:

Yes it should. Could you paste your mwan3 config please?

I am fairly certain it was correct with the previous version of mwan3 I was using, but I dont remember the V#.


config interface 'wan'
    option enabled '1'
    option count '1'
    option timeout '2'
    option interval '5'
    option down '3'
    option up '8'
    option reliability '1'

config interface 'wan2'
    option enabled '1'
    option reliability '1'
    option count '1'
    option interval '5'
    option down '3'
    option up '8'
    option timeout '5'

config policy 'wan_only'
    list use_member 'wan_m10_w10'

config policy 'wan2_only'
    list use_member 'wan2_m10_w10'

config policy 'wan_wan2'
    list use_member 'wan_m10_w10'
    list use_member 'wan_m20_w10'

config policy 'wan2_wan'
    list use_member 'wan2_m10_w10'
    list use_member 'wan_m20_w10'

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

config member 'wan_m10_w10'
    option interface 'wan'
    option metric '10'
    option weight '10'

config member 'wan2_m10_w10'
    option interface 'wan2'
    option metric '10'
    option weight '10'

config member 'wan_m20_w10'
    option interface 'wan'
    option metric '20'
    option weight '10'

config member 'wan2_m20_w10'
    option interface 'wan2'
    option metric '20'
    option weight '10'

(Last edited by JohnV on 17 Oct 2014, 18:06)

JohnV wrote:

config policy 'wan_wan2'
    list use_member 'wan_m10_w10'
    list use_member 'wan_m20_w10'

You do not have a wan2 member in this policy.

(Last edited by arfett on 17 Oct 2014, 18:40)

arfett wrote:
JohnV wrote:

config policy 'wan_wan2'
    list use_member 'wan_m10_w10'
    list use_member 'wan_m20_w10'

You do not have a wan2 member in this policy.


Strange, but correct.

Must have fallen out somewhere, or a typo from a dev.

Sorry to bother everyone.

Good evening,

  I'm looking for a dual wan script and I think this one might be what I'm looking for. I will describe below what I need and I hope someone can tell me if this package can do this.

  I have two WANs, one is static ip (manually set) that I'm gonna call WAN #1 and the other is pppoe with static ip that I'm gonna call WAN #2.

  I want WAN #1 to be my primary link, if it goes down, test if WAN #2 is up and switch to WAN #2, if WAN #1 comes back online, switch back to WAN #1, if both links are down, test each one within 5 minutes and switch to whatever comes online first.

  Also, how is the check of WAN status made? Because from what I've searched, it works better if pinging a highly available ip like 8.8.8.8, some scripts I've seen pings only the WAN's gateway which sometimes is up but the connectivity itself is down somewhere else.

Thanks in advance!

fggs wrote:

Good evening,

  I'm looking for a dual wan script and I think this one might be what I'm looking for. I will describe below what I need and I hope someone can tell me if this package can do this.

  I have two WANs, one is static ip (manually set) that I'm gonna call WAN #1 and the other is pppoe with static ip that I'm gonna call WAN #2.

  I want WAN #1 to be my primary link, if it goes down, test if WAN #2 is up and switch to WAN #2, if WAN #1 comes back online, switch back to WAN #1, if both links are down, test each one within 5 minutes and switch to whatever comes online first.

  Also, how is the check of WAN status made? Because from what I've searched, it works better if pinging a highly available ip like 8.8.8.8, some scripts I've seen pings only the WAN's gateway which sometimes is up but the connectivity itself is down somewhere else.

Thanks in advance!

MWAN3 will do what you want easily. It uses ICMP ping to whatever IP address you want to determine if the link is online.

http://wiki.openwrt.org/doc/howto/mwan3

arfett wrote:

MWAN3 will do what you want easily. It uses ICMP ping to whatever IP address you want to determine if the link is online.

http://wiki.openwrt.org/doc/howto/mwan3

Thanks! That's awesome! I forgot to mention, can I also choose manually which WAN to use?

fggs wrote:

Thanks! That's awesome! I forgot to mention, can I also choose manually which WAN to use?

Yes.

arfett wrote:
Vahe91 wrote:

i have same problem after installing build BB 14.07 at 2.10.2014

BB 14.07 is broken not the package. This is a comon issue since the final release if you google the problem or look on the forum. I installed BB 14.07 and did a reset to defaults and opkg.conf was still pointing to trunk package repositories and I was unable to install any packages.

I was able to install mwan3 luci app on BB 14.97 by issuing

root@ap-main:/tmp# IPKG_NO_SCRIPT=1
root@ap-main:/tmp# export IPKG_NO_SCRIPT
root@ap-main:/tmp# opkg install mwan3_latest_all.ipk
Installing mwan3 (1.4-24) to root...
Configuring mwan3.
Configuring luci-app-mwan3.

Not yet fully set up new installation, but luci interface seems to be working

Hello!
How stable is latest mwan3 with barrier_breaker/14.07 now?
Are there known issues?

(Last edited by md55 on 23 Oct 2014, 07:41)

md55 wrote:

How stable is latest mwan3 with barrier_breaker/14.07 now?
Are there known issues?

I'm not aware of any current issues..

is it possible to get some debug output?
because since yesterday both interfaces are tagged as offline even they are online.

netbus wrote:

is it possible to get some debug output?
because since yesterday both interfaces are tagged as offline even they are online.

There are no debug options. Only debugging is by troubleshooting. The reason your wans are marked offline is probably because the track-ip host you are trying to reach is unresponsive. You could try and ping it yourself and see if this is indeed the case.

How do I use the mwan3 package with an interface that is not listed in the /etc/config/network ?
Example:
I have a dual radio and use the 5G as client for a wirelees network towards a 4G modem that exposes a wireless network ?
It says that the interface is wither not present or that it does not have a default route in the main routing table

It has a default route and a metric set up on it but of course as being wireless it does not appear in the /etc/config/network

Thx
Adrian

asergiu wrote:

How do I use the mwan3 package with an interface that is not listed in the /etc/config/network ?

You can't. It has to be in /etc/config/network

asergiu wrote:

Example:
I have a dual radio and use the 5G as client for a wirelees network towards a 4G modem that exposes a wireless network ?
It says that the interface is wither not present or that it does not have a default route in the main routing table

It has a default route and a metric set up on it but of course as being wireless it does not appear in the /etc/config/network

How did you configure this wireless interface, as it does have an ip address?

You can't. It has to be in /etc/config/network

Why ? You can add networks that are not in /etc/config/network ! Take a look here in the images. I can send you the configs as well - stripped of wifi paswords.

How did you configure this wireless interface, as it does have an ip address?

Interfaces
https://drive.google.com/file/d/0BzUgSM … sp=sharing
Wifi Interfaces - one in client mode
https://drive.google.com/file/d/0BzUgSM … sp=sharing
Wifi Interfaces - edit interface
https://drive.google.com/file/d/0BzUgSM … sp=sharing

So the Bouygues4G interface was created when I set up the Wifi 5G in client mode and connected it to the 4G modem. I said "create interface" and the name was Bouygues 4G. Then I setup the interface with DHCP - so is getting its IP address from the 4G modem. I assinged it a firewall zone as well and that's it.

Can we discuss this over skype or some IM (hangouts ) ? - maybe I can contribute as well to mwan3 if necessary ?

Thx,
Adrian

(Last edited by asergiu on 28 Oct 2014, 11:47)

Then it is in your /etc/config/network...