Reply
New Member
Posts: 7
Registered: ‎06-14-2017
Accepted Solution

Dual WAN with failover, default route from local

I have got EdgeRouter Luite with newest firmware 1.9.1.1. Just set up dual WAN with failover (with standard wizard) . Both links have static ip, their gateways are in separate static routing tables (as the wizard created). Load-balance entry has lb-local "enable".

 

 

load-balance {
    group LB {
        interface eth0 {
            route {
                table 1
            }
            route-test {
                initial-delay 30
                interval 10
                type {
                    ping {
                        target 8.8.8.8
                    }
                }
            }
        }
        interface eth1 {
            failover-only
            route {
                table 2
            }
            route-test {
                initial-delay 30
                interval 10
                type {
                    ping {
                        target 8.8.8.8
                    }
                }
            }
        }
        lb-local enable
    }
}

 

Now - from LAN everything is working. From "local" not - 

 

ubnt@ubnt:~$ ping 8.8.8.8
connect: Network is unreachable

 

when I manually add default route for current running interface (eth1) with:

ubnt@ubnt:~$ sudo route add default gw X.X.X.X

 

it works just fine...

so - what to check, change, etc to make it work as it should (lb-local should do the trick, right?) adding default routes in two places (main routing table and table dedicated to loadbalance entry) is rather redundant..


Accepted Solutions
SuperUser
Posts: 7,072
Registered: ‎01-05-2012
Kudos: 1862
Solutions: 925

Re: Dual WAN with failover, default route from local

The
set protocols static route 0.0.0.0/0 next-hop x.x.x.x
And
set protocols static route 0.0.0.0/0 next-hop y.y.y.y
Sorry, I'm with cell ....

View solution in original post


All Replies
New Member
Posts: 7
Registered: ‎06-14-2017

Re: Dual WAN with failover, default route from local

without this default route DNS forward does not work, so it is a must for me.

some more snippets from config:

protocols {
    static {
        ...
        table 1 {
            route 0.0.0.0/0 {
                next-hop X.X.X.X {
                }
            }
        }
        table 2 {
            route 0.0.0.0/0 {
                next-hop Y.Y.Y.Y {
                }
            }
        }
    }
}
...
service {
    nat {
        rule 5000 {
            description "NAT 1"
            outbound-interface eth0
            type masquerade
        }
        rule 5001 {
            description "NAT 2"
            outbound-interface eth1
            type masquerade
        }
    }
}
SuperUser
Posts: 7,072
Registered: ‎01-05-2012
Kudos: 1862
Solutions: 925

Re: Dual WAN with failover, default route from local

Try

set load-balance group LB lb-local disable

commit

save

Sometimes, lb-local has issues ....

New Member
Posts: 7
Registered: ‎06-14-2017

Re: Dual WAN with failover, default route from local

nope.. same:

ubnt@ubnt:~$ configure
ubnt@ubnt# set load-balance group LB lb-local disable
ubnt@ubnt# commit
ubnt@ubnt# exit
ubnt@ubnt:~$ ping 8.8.8.8
connect: Network is unreachable

ubnt@ubnt:~$ configure
ubnt@ubnt# set load-balance group LB lb-local enable
ubnt@ubnt# commit
ubnt@ubnt# exit
ubnt@ubnt:~$ ping 8.8.8.8
connect: Network is unreachable

as I said earlier - the issue is only from router. LAN works as it should and packets are routed to next-hop of active link

Senior Member
Posts: 3,796
Registered: ‎05-15-2014
Kudos: 1355
Solutions: 263

Re: Dual WAN with failover, default route from local

This specific issue was discussed and seems to be fixed in 1.9.7-beta1. Please upgrade and give it a try.

Also lb-local is still broken so keep it disabled.

New Member
Posts: 7
Registered: ‎06-14-2017

Re: Dual WAN with failover, default route from local

How can I download beta version of fw?

Senior Member
Posts: 3,796
Registered: ‎05-15-2014
Kudos: 1355
Solutions: 263

Re: Dual WAN with failover, default route from local

[ Edited ]

Get it from HERE but first you must subscribe for Beta access through your Account Settings.

New Member
Posts: 7
Registered: ‎06-14-2017

Re: Dual WAN with failover, default route from local

OK. I have 1.9.7.beta1 - nothing changed. Still have "network unreachable" when trying to ping from device.

 

I noticed also strange behavior of switching (I do not know if it arised after upgrade) - when I connect primary link status and watchdog shows it is current one, but traceroute from LAN shows that packets are routed through secondary gateway... When I reload load balancing (like commit change to lb-local) - it finally switches to primary route. Without reload - seems it would use secondary forever. Same when I disconnect primary link. Status and watchdog shows that secondary is active, but from LAN I get "[router IP]: network unreachable" until I reload load-balancing config...

 

It seems that failover is pretty buggy... Does anyone have working stable and tested config?

If you need some more info on config on my device - just name it and I will provide extra info...

 

ubnt@ubnt:~$ sudo ip route show
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.153
192.168.3.0/24 dev eth2  proto kernel  scope link
192.168.13.0/24 dev eth2.13  proto kernel  scope link
Y.Y.Y.Y/29 dev eth1  proto kernel  scope link  src Y.Y.Y.Y

ubnt@ubnt:~$ sudo ip route show t 1
default via 192.168.1.3 dev eth0
127.0.0.0/8 dev lo  scope link
Y.Y.Y.Y/29 dev eth1  scope link

ubnt@ubnt:~$ sudo ip route show t 2
default via Y.Y.Y.Y dev eth1
127.0.0.0/8 dev lo  scope link
Y.Y.Y.Y/29 dev eth1  scope link
Senior Member
Posts: 3,796
Registered: ‎05-15-2014
Kudos: 1355
Solutions: 263

Re: Dual WAN with failover, default route from local

See THIS for the lb-local issues.

In general yes, load-balancing works but each case configuration is specific (in my experience). It mostly depends on what interfaces are involved (pppoe or eth). Some elaboration HERE and HERE.

SuperUser
Posts: 7,072
Registered: ‎01-05-2012
Kudos: 1862
Solutions: 925

Re: Dual WAN with failover, default route from local

Did you even set the table main?
New Member
Posts: 7
Registered: ‎06-14-2017

Re: Dual WAN with failover, default route from local

What do you mean by that?

SuperUser
Posts: 7,072
Registered: ‎01-05-2012
Kudos: 1862
Solutions: 925

Re: Dual WAN with failover, default route from local

The
set protocols static route 0.0.0.0/0 next-hop x.x.x.x
And
set protocols static route 0.0.0.0/0 next-hop y.y.y.y
Sorry, I'm with cell ....
New Member
Posts: 7
Registered: ‎06-14-2017

Re: Dual WAN with failover, default route from local

That would probably do the trick (I mentioned in first post that adding default route with "sudo route add" solved local traffic problems), but shouldn't it be handled with LB tables per interface?

This means I have to put default routes both in main table and in dedicated tables for LB, right?

SuperUser
Posts: 7,072
Registered: ‎01-05-2012
Kudos: 1862
Solutions: 925

Re: Dual WAN with failover, default route from local

Yes, but now you are doing two different things, have a look at the PBR article and at the WLB article.
Cheers
Reply