OpenWrt Forum Archive

Topic: New package: mwan2; testers wanted.

The content of this topic has been archived between 31 Mar 2018 and 27 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

Yep. That was it.  It's now load balancing across both my links -- even with multiple sessions to the same destination.

Thanks!

Hi Adze

now that mwan2 has all the feature of the multiwan package (sessions load balancing) (and much more) it's a perfect replacement for it
can you submit it to the mailing list so it can be integrated in openwrt?

thanks for your great work

I would also suggest adding a good LUCI package to select from the common multi-wan configurations.   For example:
1) Convert 1 of the LAN ports to a 2nd WAN port.
2) Convert 2 of the LAN ports to 2nd & 3rd WAN ports.
3) Convert 3 of the LAN ports to 2nd, 3rd, 4th WAN ports
4) Convert all of the LAN port to WAN ports and use the original WAN port for LAN traffic.
...

For each of these include weights and metrics options.
Maybe include a LED configuration page too smile

Any more suggestions?

(Last edited by Sorbe on 17 Aug 2012, 21:25)

I just wanted to offer a special thanks to Adze for all his great efforts to both develop and perfect MWAN2.  This project would never have happened without his solid efforts on creating the technology and supporting all of the beta testers on this thread.  I think he deserves some very large kudos for pulling this off multi-wan routing support on OpenWRT given the complexity of the problem and lack of this open source feature anywhere else.

Certainly we are very lucky when Adze decided to make public its excellent design. Normally developers hide this kind of work. Thank you very much Adze!

BusyBox v1.15.3 (2011-11-24 00:44:20 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 Backfire (10.03.1, r29592) ------------------------
  * 1/3 shot Kahlua    In a shot glass, layer Kahlua
  * 1/3 shot Bailey's  on the bottom, then Bailey's,
  * 1/3 shot Vodka     then Vodka.
  by WinServ Ti - www.winserv.com.br + wr741nd
 ---------------------------------------------------
root@router01:~# ip route show table 3
default  metric 1
        nexthop via 192.168.25.1  dev eth1 weight 3
        nexthop via 187.86.xxx.xxx  dev eth0.4 weight 1
root@router01:~#

(Last edited by celosam on 22 Aug 2012, 12:35)

If i change the config, need to ifdown / ifup any interface to changes effect. Is there any other way?

LaySoft wrote:

If i change the config, need to ifdown / ifup any interface to changes effect. Is there any other way?

Trigger a hotplug event:

ACTION=ifup DEVICE=eth1 INTERFACE=wan1 /sbin/hotplug-call iface

Replace "eth1" and "wan1" with the correct values.

(Last edited by Adze on 23 Aug 2012, 08:50)

Thank you, it works!

Been using the script for a little over a month now and it's great! Thanks again Adze for making this script and most especially for making it publicly available. I just discovered how hard it is to find multiwan stuff this easy to use as my recently purchased RT-N16 isn't supported by openwrt yet. So thank you very much for this.

Hi Adze!

In the first post you explained main config options, some of others is similar to the corresponding ones in multiwan config:

interval -> health_interval

timeout -> timeout

But count, down, up, are not clear for me.

Where can i find detailed description of mwan2 config options?

(Last edited by LaySoft on 23 Aug 2012, 13:56)

Hi LaySoft,


Documentation for mwan2 is (still) very limited... I'll try to explain the options here:

interval --> number of seconds to wait in between each reachability test
timeout --> number of seconds to wait for echo-reply
count --> number of icmp requests to send each test
up --> number of consecutive successful tests before interface is considered UP
down --> number of consecutive failed tests before interface is considered DOWN


@Everybody: Thanks for the kudos  big_smile

(Last edited by Adze on 23 Aug 2012, 16:05)

Thank you Adze, now everything clear!

Hi again Adze, whats new in 1.4-3?

gendouhydeist wrote:

Hi again Adze, whats new in 1.4-3?

1.4-3 Fixed a bug: "not completely removing interface from iptables when interface goes down"

Found another bug yesterday, so 1.4-4 is coming.. This bug is causing incorrect setup of rules if a combination of "gateways without nexthop ip address" and "equalize" is used. This can be found is some ppp setups.

On a side note: I have almost finished a new version of mwan2 --> mwan3. With mwan3 you now will get true policy routing. In mwan2 it was not possible to have different primary and secondary wan's for different traffic patterns. In mwan3 it is possible. The reason i named it mwan3 is because the config file has changed dramatically. It is incompatible with mwan2. Also i have changed code from the lessons i learned from mwan2.

(Last edited by Adze on 26 Aug 2012, 11:21)

Awesome! could that fixed the problem that I'm having? The dest_ip website on specified interface both 1.4-3 and 1.3-4?

and oh! could you please try to access my router again, I've finally made it work just access it anytime. I wanted to know why there's two syn request on my router with antenna (wan2) and also to learn more about openwrt networking thanks!!

Hi Adze!

Which configuration you develop/test mwan2? Are you using USB 3g stick, or test with two cable wan? Which is the recommended hardware for one cable wan, and one 3g stick configuration?

I have multiple routers, multiple setups...

The one i use for production has two static configured ethernet WAN's and one 3G dongle. It runs on a Netgear WNDR3700v2.

(Last edited by Adze on 27 Aug 2012, 13:36)

Hi Adze, have you already access my router? any findings thanks!

Do you think this might have something to do with same subnet, my router and antenna (wan2)? The wan2 is configured as DHCP Client.

(Last edited by gendouhydeist on 27 Aug 2012, 15:37)

gendouhydeist wrote:

Hi Adze, have you already access my router? any findings thanks!

Do you think this might have something to do with same subnet, my router and antenna (wan2)? The wan2 is configured as DHCP Client.

Yes i have taken a quick peak and found your problem in 5 sec...

The order of the rules in mwan2 config is important. You started with a default (0.0.0.0/0) rule. So all next configured rules were ignored. I have changed the order. Please try again...

Remember rule order is important!

(Last edited by Adze on 27 Aug 2012, 15:51)

Oh great! It works now! Thanks man! now I don't need to turn off my wan really appreciated!

anyways what about my wan2 having dual syn? I still seeing it on tcpdump.

gendouhydeist wrote:

Oh great! It works now! Thanks man! now I don't need to turn off my wan really appreciated!

anyways what about my wan2 having dual syn? I still seeing it on tcpdump.

Nice  big_smile

Don't know why there are 2 syn's. I guess you have some homework... wink

Ok no problem smile my guess is to change the IP and the subnet of my 2nd wan gonna try that first.

Thanks man really! great man and his awesome package!

(Last edited by gendouhydeist on 27 Aug 2012, 16:42)

Hi all,


I have found a way to also load-balance traffic originating from the router itself. This is very easy.. smile

If you have a working mwan2 setup, you can "tell" the router to always use it's lan address as the source address for new connections:

ip route add default via 127.0.0.1 dev lo src 192.168.x.x

Replace 192.168.x.x with the lan ip address of your router. Mwan2 will now come into play when determining next-hop.

Beware that this may effect firewall settings as traffic from the router now also passes the FORWARD chain.

(Last edited by Adze on 27 Aug 2012, 20:06)

Hi Adze,

I am using OpenWRT Backfire with your script 1.4.-3 with WAN as dhcp and WAN2 as 3g dongle for failover on TL-MR3420. I am using free Internet 3g service in my country which is delivered by Aero2. This service is free, however, with some limitations, the most frustrating is that 3g connection is droping every 60 minutes, so I have implemented 3gtester script, which restore connection when broken. It is runing every 3 minutes from cron, pls. see below:


/bin/3gtester

#!/bin/sh
[ "x"$(uci -q get network.wan2.proto) == "x3g" ] || return
[ "x"$(uci -q get network.wan2.auto) == "x1" ] || return
[ -e $(uci -q get network.wan2.device) ] || return
if ! ping -q -c 3 -I 3g-wan2 -W 10 8.8.4.4 > /dev/null; then
        logger -t 3gtester "Restarting 3G connection"
        (ifup wan2) &
fi

/etc/config/network

config 'interface' 'wan'
        option 'ifname' 'eth1'
        option 'proto' 'dhcp'
        option 'metric' '10'

config 'interface' 'wan2'
        option 'proto' '3g'
        option 'service' 'umts'
        option 'device' '/dev/ttyUSB0'
        option 'apn' 'darmowy'
    option 'defaultroute' '0'
        option 'auto' '1"

config 'route'
    option 'interface' 'wan2'
    option 'target' '0.0.0.0'
    option 'netmask' '0.0.0.0'
    option 'metric' '20'

/etc/config/mwan2

config 'interface' 'wan'
        option 'enabled' '1'
        option 'metric' '1'
        option 'weight' '1'
        option 'track_ip' '8.8.8.8'
        option 'count' '1'
        option 'timeout' '10'
        option 'interval' '5'
        option 'down' '3'
        option 'up' '3'

config 'interface' '3g'
        option 'enabled' '1'
        option 'metric' '2'
        option 'weight' '1'

config 'rule'
        option 'dest_ip' '0.0.0.0/0'
        #option 'equalize' '1'
        list 'use_interface' 'wan'
        list 'use_interface' 'wan2'

Failover with mwan2 works rather smooth, but only few hours, I found that after 12+ hours of router uptime, it is loosing default route to wan2, so I can't see UG for wan2.
I can restart the router and it works fine for the next couple of hours, but this issue is permanent ;/
Any clue ?

(Last edited by walterm on 28 Aug 2012, 09:39)

Hi Walterm,

walterm wrote:

Failover with mwan2 works rather smooth, but only few hours, I found that after 12+ hours of router uptime, it is loosing default route to wan2, so I can't see UG for wan2.

Is it losing the route in the main routing table, or in one of the mwan2 routing tables?

Sorry, posts 301 to 300 are missing from our archive.