OpenWrt Forum Archive

Topic: Dual-WAN Load Balancing

The content of this topic has been archived between 4 Apr 2018 and 1 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Just compiled trunk. Installed latest version(2010-03-02 20:08:21) of ftp://ftp.netlab7.com/dualwan_0.1k.ipk.

Changed network config:

root@OpenWrt:/# cat /etc/config/network 
#### VLAN configuration 
config switch eth0
        option enable   1

config switch_vlan eth0_0
        option device   "eth0"
        option vlan     0
        option ports    "0 1 2 5"

config switch_vlan eth0_1
        option device   "eth0"
        option vlan     1
        option ports    "4 5"

config switch_vlan eth0_2
        option device   "eth0"
        option vlan     2
        option ports    "3 5"

#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr   127.0.0.1
        option netmask  255.0.0.0


#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr   192.168.2.1
        option netmask  255.255.255.0


#### WAN configuration
config interface        wan
        option ifname   "eth0.1"
        option proto    dhcp
        
config interface        wan2
        option ifname   "eth0.2"
        option proto    dhcp

Reboot and wait...everything looks good:

Jan  1 00:11:51 OpenWrt user.notice root: [Dual-WAN Notice]: Could not acquire the Secondary WAN Gateway... Will retry in 1 minute.
Jan  1 00:12:52 OpenWrt user.notice root: [Dual-WAN Notice]: Could not acquire the Secondary WAN Gateway... Will retry in 1 minute.
Jan  1 00:13:53 OpenWrt user.notice root: [Dual-WAN Notice]: Could not acquire the Secondary WAN Gateway... Will retry in 1 minute.

As soon as I plug the WAN2 cable, router hangs, or at least LAN stops working.

WAN is on 192.168.3.x
WAN2 is on 192.168.4.x
Plataform is brcm47xx 2.6, Asus WL500GP V2

nunojpg wrote:

Just compiled trunk. Installed latest version(2010-03-02 20:08:21) of ftp://ftp.netlab7.com/dualwan_0.1k.ipk.

Reboot and wait...everything looks good:

Jan  1 00:11:51 OpenWrt user.notice root: [Dual-WAN Notice]: Could not acquire the Secondary WAN Gateway... Will retry in 1 minute.
Jan  1 00:12:52 OpenWrt user.notice root: [Dual-WAN Notice]: Could not acquire the Secondary WAN Gateway... Will retry in 1 minute.
Jan  1 00:13:53 OpenWrt user.notice root: [Dual-WAN Notice]: Could not acquire the Secondary WAN Gateway... Will retry in 1 minute.

As soon as I plug the WAN2 cable, router hangs, or at least LAN stops working.

WAN is on 192.168.3.x
WAN2 is on 192.168.4.x
Plataform is brcm47xx 2.6, Asus WL500GP V2

I think I know what the issue is, the latest should take care of it.
ftp://ftp.netlab7.com/dualwan_0.1l.ipk

I've also made changes to the load balancer and auto load balancer, so that it only attempts to load balance new connections. I think this possibly was creating issues when attempting to use the balancer feature.

Thanks, and let me know if this resolves that issue.
-Craig

It appears the load balancer needs more work, I can see the issue.
However, everything else should work fine.

SouthPawn wrote:

It appears the load balancer needs more work, I can see the issue.
However, everything else should work fine.

I am trying out your dual wan config under kamikaze 8.09.2 but as you said the load balancer doesn't work. Do you know when you plan to release a new version?

I saw also that if the gateway attached to an interface can't be reached by ping (eg , if the internet provider blocks it, for example free.fr using bridge mode for its access) your script doesn't work.

Would it be possible to test a well known machine like google.com, forcing to use an interface with the ping -I eth0.1 or ping -I eth0.2 command?

Here is on output of these commands...

root@dualwan:~# ping -I eth0.1  orange.fr
PING orange.fr (193.252.122.103): 56 data bytes
64 bytes from 193.252.122.103: seq=0 ttl=245 time=46.598 ms
64 bytes from 193.252.122.103: seq=1 ttl=245 time=45.657 ms
64 bytes from 193.252.122.103: seq=2 ttl=245 time=46.808 ms
64 bytes from 193.252.122.103: seq=3 ttl=245 time=46.386 ms
64 bytes from 193.252.122.103: seq=4 ttl=245 time=46.253 ms
64 bytes from 193.252.122.103: seq=5 ttl=245 time=45.569 ms
64 bytes from 193.252.122.103: seq=6 ttl=245 time=46.324 ms
^C
--- orange.fr ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 45.569/46.227/46.808 ms
root@dualwan:~# ping -I eth0.2  orange.fr
PING orange.fr (193.252.149.30): 56 data bytes
64 bytes from 193.252.149.30: seq=0 ttl=245 time=58.869 ms
64 bytes from 193.252.149.30: seq=1 ttl=245 time=57.766 ms
64 bytes from 193.252.149.30: seq=2 ttl=245 time=58.026 ms
64 bytes from 193.252.149.30: seq=3 ttl=245 time=58.121 ms
64 bytes from 193.252.149.30: seq=4 ttl=245 time=58.863 ms
64 bytes from 193.252.149.30: seq=5 ttl=245 time=58.150 ms
^C
--- orange.fr ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 57.766/58.299/58.869 ms
root@dualwan:~#


Thanx a lot for your nice work.

(Last edited by mynetmemo on 8 Mar 2010, 15:48)

I finally gave up on running the current trunk version of WNDR3700, too many issues, and went back to the stock firmware. That allowed me to reinstall my WRT54GL under OpenWRT with the 2.6 kernel and dedicating the WNDR to wireless duties.

Long story short: Dual-Wan works fine on WRT54GL under the 2.6 kernel.

I do have a request: currently, Dual-Wan performs fail-over and balancing based on pinging the gateway for each link. In my case, the gateways (DSL routers) are sitting right next to the OpenWRT router, and what I would like to ping is a "neutral" internet host.

I tried changing (in /usr/bin/dualwan)

TESTGW1=`ping -c 1 -W 5 $GW1 2>&1 | grep round-trip | awk -F "/" '{print $4}'`

to

TESTGW1=`ping -c 1 -W 5 88.191.76.115 -I $if_wan1 2>&1 | grep round-trip | awk -F "/" '{print $4}'`

but since there is no default route for using the secondary gateway, my ping isn't getting through.

Do you have a suggestion? I was about to try finding two equivalent "neutral" hosts, settings up Dual-Wan exception rules for each (ICMP), and pinging those, but that seems like a pretty brittle method.

SouthPawn,

I did apply my suggestion, and it does seem to work. From a UI perspective, it would be great if you could add two fields to allow admin to set the IP to ping for each WAN, overriding the default of pinging the gateways.

rockpilp wrote:

SouthPawn,

I did apply my suggestion, and it does seem to work. From a UI perspective, it would be great if you could add two fields to allow admin to set the IP to ping for each WAN, overriding the default of pinging the gateways.

I'm sorry but I didn't understand what you mean. My poor english may be the reason :-(

Can you tell me the modifications you made in the files?

Thank you rockpilp...

(Last edited by mynetmemo on 8 Mar 2010, 18:11)

rockpilp wrote:

SouthPawn,

I did apply my suggestion, and it does seem to work. From a UI perspective, it would be great if you could add two fields to allow admin to set the IP to ping for each WAN, overriding the default of pinging the gateways.

This has been brought to the Multi-WAN script, I also beleive the load balancer works now, though it's hard for me to test without an actual second WAN.

https://forum.openwrt.org/viewtopic.php?id=23904

The discussion might have continued from here.