OpenWrt Forum Archive

Topic: Multi-WAN Load Balancing

The content of this topic has been archived between 29 Mar 2018 and 3 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Same gateway address for both WANs = trouble load-balancing AFAIK.

Yup, no idea why.

Also, as you can tell I have the same ISP. Is it possible to channel bond the connection through two cable wan's?

I want tell all users asking for support in same gateway loadbalancing,

well this is a multiwan bug, i checked when i got the same gateway of my ISP, because i have the 2 internet lines of the same ISP.

To fix that, you must NAT the lines to have differents gateway because if the multiwan check you have gateway with the same IP, he will think is only 1 internet line so this will not balance.

Also the MultiWan is bug with QoS, they cannot work together.. multiwan do not make the QoS work, that is the only very bad bug here.

I need QoS with my MultiWans, the script must be get fixed soon because it will kill my mind thinking how fix that!

(Last edited by freddyarenas on 28 Apr 2012, 07:31)

Can anyone please upload the two files posted in the first post? The provided links are dead.

Hi All,

Wondering if someone might lend me their wisdom for this issue I'm getting - I'm sure I've screwed something up but not 100% sure where.
Have configured a Netgear WNDR3700v2 with Multi-WAN installed from vanilla 10.03.1 and the multi-wan package from the luci interface.
It appears that all my traffic goes down the PPPoE interface - this is the only one displayed in the Status - Overview.
ip route gives:

203.215.17.248 dev pppoe-wan1  proto kernel  scope link  src 203.206.128.62
192.168.16.0/24 dev br-lan  proto kernel  scope link  src 192.168.16.1
203.33.119.0/24 dev eth1  proto kernel  scope link  src 203.33.119.250
default via 203.215.17.248 dev pppoe-wan1
default via 203.33.119.1 dev eth1

So I can see that both default gateways are present - but ip route show table 123 gives nothing, making me think I've done something wrong


cat /etc/config/network

config 'interface' 'loopback'
        option 'ifname' 'lo'
        option 'proto' 'static'
        option 'ipaddr' '127.0.0.1'
        option 'netmask' '255.0.0.0'

config 'interface' 'lan'
        option 'ifname' 'eth0.1'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'netmask' '255.255.255.0'
        option 'ipaddr' '192.168.16.1'

config 'interface' 'wan'
        option 'ifname' 'eth1'
        option '_orig_ifname' 'eth1'
        option '_orig_bridge' 'false'
        option 'proto' 'static'
        option 'ipaddr' '203.33.119.250'
        option 'netmask' '255.255.255.0'
        option 'gateway' '203.33.119.1'
        option 'dns' '203.33.113.3'

config 'switch'
        option 'name' 'rtl8366s'
        option 'reset' '1'
        option 'enable_vlan' '1'
        option 'blinkrate' '2'
        option 'enable_vlan4k' '1'

config 'switch_vlan'
        option 'device' 'rtl8366s'
        option 'vlan' '1'
        option 'ports' '0 1 2 5t'

config 'switch_port'
        option 'device' 'rtl8366s'
        option 'port' '1'
        option 'led' '6'

config 'switch_port'
        option 'device' 'rtl8366s'
        option 'port' '2'
        option 'led' '9'

config 'switch_port'
        option 'device' 'rtl8366s'
        option 'port' '5'
        option 'led' '2'

config 'switch_vlan'
        option 'device' 'rtl8366s'
        option 'vlan' '2'
        option 'ports' '3 5t'

config 'interface' 'wan1'
        option 'proto' 'pppoe'
        option 'ifname' 'eth0.2'

cat /etc/config/multiwan

config 'multiwan' 'config'
        option 'default_route' 'fastbalancer'

config 'interface' 'wan'
        option 'timeout' '3'
        option 'health_fail_retries' '3'
        option 'health_recovery_retries' '5'
        option 'dns' 'auto'
        option 'health_interval' 'disable'
        option 'icmp_hosts' 'disable'
        option 'weight' '5'
        option 'failover_to' 'disable'

config 'mwanfw'
        option 'wanrule' 'fastbalancer'

config 'interface' 'wan1'
        option 'timeout' '3'
        option 'health_fail_retries' '3'
        option 'health_recovery_retries' '5'
        option 'dns' 'auto'
        option 'failover_to' 'disable'
        option 'health_interval' 'disable'
        option 'icmp_hosts' 'disable'
        option 'weight' '5'

Use these commands:

ip route show table LoadBalancer
iptables -L MultiWanRules -t mangle -v
ip route get xxx.xxx.xxx.xxx
ping -c 100 -s 1400 -W 10 -I eth0.1  4.2.2.2

Hi all,

I recently test to run openwrt with multi wan package (with 2 wan connections in dhcp, x86 plateform, not to switch vlan..).

Here is my network and multiwan configuration

----------------
cat /etc/config/network
config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config interface 'lan'
    option ifname 'eth0'
    option type 'bridge'
    option proto 'static'
    option netmask '255.255.255.0'
    option ipaddr '192.168.2.251'
    option stp '1'
    option broadcast '192.168.2.255'

config interface 'wan'
    option proto 'dhcp'
    option _orig_ifname 'eth1'
    option _orig_bridge 'false'
    option ifname 'eth1'
    option accept_ra '0'
    option send_rs '1'
    option gateway '0'

config interface 'wan2'
    option proto 'dhcp'
    option _orig_ifname 'eth2'
    option _orig_bridge 'false'
    option ifname 'eth2'
    option accept_ra '0'
    option send_rs '1'
    option gateway '0'

----------------
cat /etc/config/multiwan
config multiwan 'config'
    option health_monitor 'serial'
    option enabled '1'
    option debug '1'
    option default_route 'fastbalancer'

config interface 'wan'
    option dns 'auto'
    option timeout '3'
    option weight '10'
    option health_interval '5'
    option icmp_hosts 'disable'
    option health_fail_retries '3'
    option health_recovery_retries '3'
    option failover_to 'wan2'

config interface 'wan2'
    option dns 'auto'
    option timeout '3'
    option weight '10'
    option health_interval '5'
    option icmp_hosts 'disable'
    option health_fail_retries '3'
    option health_recovery_retries '3'
    option failover_to 'wan'

----------------
ip route show table LoadBalancer
default  proto static
    nexthop dev eth1 weight 10
    nexthop dev eth2 weight 10
wan1sub/24 dev eth1  proto kernel  scope link  src wan1ip
wan2sub/24 dev eth2  proto kernel  scope link  src wan2ip
192.168.2.0/24 dev br-lan  proto kernel  scope link  src 192.168.2.251

----------------
ip route
wan1sub/24 dev eth1  proto kernel  scope link  src wan1ip
wan2sub/24 dev eth2  proto kernel  scope link  src wan2ip
192.168.2.0/24 dev br-lan  proto kernel  scope link  src 192.168.2.251


Only one wan works, the multi wan distribution is not done. Do you have an idea?

ping -I eth1  8.8.8.8
is down
ping -I eth2  8.8.4.4
is down


When I add the manually the route (ip route add default via wan1gw dev eth1 metric 0 && ip route add default via wan2gw.xxx.xxx.xxx dev eth2 metric 1), the 2 ping work, but the router distribution is not done..

I feel badly that the packets are routed, or the routes are poorly added.
Did I miss something?

Does Multiwan  work if the WAN connections are on the same subnet and share the same default gateway?
I have two connections provides by the same isp and both protocols are DHCP.
When I setup the both WAN connections, I always get two IP addresses having the same subnet and share the same default gateway.
Does Multiwan work for this condition?

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.24.210.1    0.0.0.0         UG    0      0        0 eth2
default         172.24.210.1    0.0.0.0         UG    0      0        0 eth0.2
172.24.210.0    *               255.255.254.0   U     0      0        0 eth0.2
172.24.210.0    *               255.255.254.0   U     0      0        0 eth2
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan

(Last edited by yanggis on 1 Jan 2013, 11:47)

SouthPawn wrote:
cowboydrg wrote:

root@OpenWrt:/# ip rule
ip: RTNETLINK answers: Operation not supported
ip: dump terminated

There's the problem, it sounds like this would most likely be caused by CONFIG_IP_MULTIPLE_TABLES not being enabled in your kernel.

The reason ifdown wan2 seemingly makes it work is not because it enables failover, but because it disables the last configured interface, leaving the first wan to be the only default route and therefore all traffic goes through it. In the current setup you would see the same behavior with or without the Multi-WAN script.

Hope this helps,
-Craig


How to check if IP_MULTIPLE_TABLES is enabled in Kernel?
 
Linksys WRT160N
OpenWrt Backfire 10.03.1 / LuCI 0.10.0 Release (0.10.0)
Kernel Version    2.4.37.9

Looks like I got it somehow MultiWan script working but I'm getting another error. 

OpenWrt user.notice multiwan: Performance load balancer(fastbalanacer) is unavailable due to current kernel limitations.
OpenWrt daemon.info dnsmasq[1117]: reading /tmp/resolv.conf.auto
OpenWrt daemon.info dnsmasq[1117]: using nameserver 8.8.8.8#53
OpenWrt daemon.info dnsmasq[1117]: using nameserver 8.8.8.8#53
OpenWrt daemon.info dnsmasq[1117]: using local addresses only for domain lan
OpenWrt user.notice multiwan: Succesfully Initialized

Can anyone suggest what should I do about it?

(Last edited by Almaz on 30 Jun 2013, 12:01)

Hi SouthPawn,

I'm newbee to this, it may be silly question to you but still i want this information badly.
How can download your script, and also please provide me configuration details through multwan web page from openWRT.
and also it will be helpful if you provide me how to configure multiwan step-by-step.

thanks in advance.

(Last edited by Ramesh_P on 6 Sep 2013, 14:27)

Hello friends, I'm trying to setup a mutiwan configuration with load balancing, but there is something going wrong and I can't find out what is.

I've done almost everything from the web interface, but if I need to go to the console mode I have no problems with that.

I have two ISPs, both of them with routers that do a NAT configuration, giving me just the local C class IP address.

My personal router, with OpenWRT, is a Buffalo WZR-HP-G300NH.

I have already installed the multiwan package and tryied to configure it, but I just can get the packages to flow from one of both connections.
Currently situation:
A - 1 Router (ISP) with public IP address starting in 2**.*.*.* and private address on the range of 192.168.0.0
B - 1 Router (ISP) with public IP address starting in 1**.*.*.* and private address on the range of 192.168.1.0
C - My private Router with OpenWRT serving the local network on the range 172.16.20.0.

I have setup the C router to have two WAN ports (and it seems to be working ok), but the load balancing and failsafe is not working.

Below are some informations from my C router:
# route

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.20.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0.2
192.168.0.0     *               255.255.255.0   U     0      0        0 eth1
default         MyRouter.Home   0.0.0.0         UG    0      0        0 eth0.2

ifconfig

br-lan    Link encap:Ethernet  HWaddr 00:1D:73:8F:69:96  
          inet addr:172.16.20.1  Bcast:172.16.20.254  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17098440 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16875315 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2235357076 (2.0 GiB)  TX bytes:3282329585 (3.0 GiB)

eth0      Link encap:Ethernet  HWaddr 00:1D:73:8F:69:96  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:33966054 errors:0 dropped:0 overruns:93388 frame:0
          TX packets:33865088 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1590958719 (1.4 GiB)  TX bytes:1483812589 (1.3 GiB)
          Interrupt:4 

eth0.1    Link encap:Ethernet  HWaddr 00:1D:73:8F:69:96  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17011830 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16789820 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2287658164 (2.1 GiB)  TX bytes:3247708115 (3.0 GiB)

eth0.2    Link encap:Ethernet  HWaddr 00:1D:73:8F:69:96  
          inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16953844 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17075261 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3122683035 (2.9 GiB)  TX bytes:2531070219 (2.3 GiB)

eth1      Link encap:Ethernet  HWaddr 00:1D:73:8F:69:97  
          inet addr:192.168.0.5  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:62369 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2972 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:19301889 (18.4 MiB)  TX bytes:309756 (302.4 KiB)
          Interrupt:5 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:130 errors:0 dropped:0 overruns:0 frame:0
          TX packets:130 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:12623 (12.3 KiB)  TX bytes:12623 (12.3 KiB)

mon.wlan0 Link encap:UNSPEC  HWaddr 00-1D-73-8F-69-96-00-00-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3121977 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32 
          RX bytes:755147745 (720.1 MiB)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:1D:73:8F:69:96  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:94031 errors:0 dropped:0 overruns:0 frame:0
          TX packets:133361 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32 
          RX bytes:19506653 (18.6 MiB)  TX bytes:117832293 (112.3 MiB)

/etc/config/network

config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'interface' 'lan'
    option 'type' 'bridge'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '172.16.20.1'
    option 'gateway' '172.16.20.1'
    option 'broadcast' '172.16.20.254'
    option '_orig_ifname' 'eth0 wlan0'
    option '_orig_bridge' 'true'
    option 'ifname' 'eth0.1'
    option 'dns' '208.67.222.222 208.67.220.220 8.8.8.8 8.8.4.4'

config 'interface' 'wan1'
    option 'ifname' 'eth1'
    option 'proto' 'dhcp'
    option 'hostname' 'BuffaloETH1'

config 'switch'
    option 'name' 'switch0'
    option 'reset' '1'
    option 'enable_vlan' '1'
    option 'enable_vlan4k' '1'

config 'switch_vlan'
    option 'device' 'switch0'
    option 'vlan' '1'
    option 'ports' '1 2 3 5t'

config 'switch_vlan'
    option 'device' 'switch0'
    option 'vlan' '2'
    option 'ports' '0 5t'

config 'interface' 'wan2'
    option 'proto' 'dhcp'
    option 'ifname' 'eth0.2'
    option 'hostname' 'BuffaloWAN2'

/etc/config/multiwan

config 'multiwan' 'config'
    option 'default_route' 'balancer'

config 'interface' 'wan2'
    option 'health_interval' '10'
    option 'icmp_hosts' 'gateway'
    option 'timeout' '3'
    option 'health_fail_retries' '3'
    option 'health_recovery_retries' '5'
    option 'failover_to' 'balancer'
    option 'dns' 'auto'
    option 'weight' '10'

config 'interface' 'wan1'
    option 'weight' '10'
    option 'health_interval' '10'
    option 'icmp_hosts' 'dns'
    option 'timeout' '3'
    option 'health_fail_retries' '3'
    option 'health_recovery_retries' '5'
    option 'failover_to' 'balancer'
    option 'dns' 'auto'

/etc/config/firewall

config 'defaults'
    option 'syn_flood' '1'
    option 'input' 'ACCEPT'
    option 'output' 'ACCEPT'
    option 'forward' 'REJECT'
    option 'drop_invalid' '1'

config 'zone'
    option 'name' 'lan'
    option 'network' 'lan'
    option 'input' 'ACCEPT'
    option 'output' 'ACCEPT'
    option 'forward' 'REJECT'

config 'zone'
    option 'name' 'wan'
    option 'input' 'REJECT'
    option 'output' 'ACCEPT'
    option 'forward' 'REJECT'
    option 'masq' '1'
    option 'mtu_fix' '1'
    option 'network' 'wan1 wan2'

config 'forwarding'
    option 'src' 'lan'
    option 'dest' 'wan'

config 'rule'
    option 'name' 'Allow-DHCP-Renew'
    option 'src' 'wan'
    option 'proto' 'udp'
    option 'dest_port' '68'
    option 'target' 'ACCEPT'
    option 'family' 'ipv4'

config 'rule'
    option 'name' 'Allow-DHCPv6'
    option 'src' 'wan'
    option 'proto' 'udp'
    option 'src_ip' 'fe80::/10'
    option 'src_port' '547'
    option 'dest_ip' 'fe80::/10'
    option 'dest_port' '546'
    option 'family' 'ipv6'
    option 'target' 'ACCEPT'

config 'rule'
    option 'name' 'Allow-ICMPv6-Input'
    option 'src' 'wan'
    option 'proto' 'icmp'
    list 'icmp_type' 'echo-request'
    list 'icmp_type' 'destination-unreachable'
    list 'icmp_type' 'packet-too-big'
    list 'icmp_type' 'time-exceeded'
    list 'icmp_type' 'bad-header'
    list 'icmp_type' 'unknown-header-type'
    list 'icmp_type' 'router-solicitation'
    list 'icmp_type' 'neighbour-solicitation'
    option 'limit' '1000/sec'
    option 'family' 'ipv6'
    option 'target' 'ACCEPT'

config 'rule'
    option 'name' 'Allow-ICMPv6-Forward'
    option 'src' 'wan'
    option 'dest' '*'
    option 'proto' 'icmp'
    list 'icmp_type' 'echo-request'
    list 'icmp_type' 'destination-unreachable'
    list 'icmp_type' 'packet-too-big'
    list 'icmp_type' 'time-exceeded'
    list 'icmp_type' 'bad-header'
    list 'icmp_type' 'unknown-header-type'
    option 'limit' '1000/sec'
    option 'family' 'ipv6'
    option 'target' 'ACCEPT'

config 'include'
    option 'path' '/etc/firewall.user'

ip route show table LoadBalancer

172.16.20.0/24 dev br-lan  proto kernel  scope link  src 172.16.20.1 
192.168.1.0/24 dev eth0.2  proto kernel  scope link  src 192.168.1.11 
192.168.0.0/24 dev eth1  proto kernel  scope link  src 192.168.0.5 
default via 192.168.1.1 dev eth0.2  proto static 

iptables -L MultiWanRules -t mangle -v

Chain MultiWanRules (1 references)
 pkts bytes target     prot opt in     out     source               destination         
   30  1800 FW1MARK    all  --  any    any     anywhere             www.whatismyipaddress.eu mark match 0x0 
 269K   33M LoadBalancer  all  --  any    any     anywhere             anywhere            mark match 0x0 
    0     0 LoadBalancer  all  --  any    any     anywhere             anywhere            mark match 0x0 

And if I try to ping from the eth1 interface (192.168.0.*) I don't get any answer back.

Thanks for any help!

The discussion might have continued from here.