Okay. There are two WAN lines and one LAN line.
The basic load balancing is configured like this:
wan {
flush-connections
interface-health eth4 {
failure-count 1
nexthop 8.8.8.8
success-count 10
}
interface-health eth5 {
failure-count 1
nexthop 8.8.4.4
success-count 10
}
rule 5 {
destination {
address 192.168.0.0/16
}
exclude
inbound-interface eth+
protocol all
}
rule 10 {
inbound-interface eth0
interface eth4 {
}
protocol all
}
rule 11 {
inbound interface eth0
interface eth5 {
}
protocol all
}
So far so good. That part works too, only I think there is a problem with another setting (the default gateway) and this is where my understanding problem starts.
Apparently the defaultroute has priority over the loadbalancing.
Variant1. Both WAN lines have a fixed IP without DHCP and without PPPOE.
The defaultruting entry looks like this:
route 0.0.0.0/0 {
next-hop 37.0.0.1 {
}
next-hop 109.0.0.1 { }
}
}
This works fine so far…at least until one of the lines is no longer running cleanly or is completely down. Of course the loadbalancing gets this, but not the defaultgateway. The effect was that the traffic became extremely slow. So as if 50% of the traffic is lost.
Variant2. One WAN line has a fixed IP and the second gets the IP via DHCP.
Here the problem is even clearer. The DHCP interface gets a kernel route with the metric 0 and the WAN line with the fixed IP gets 1 as the smallest metric. We now had the case that the line with DHCP was defective at the provider. I.e. it was quasi online, but without traffic. End of the story, nothing worked. He always tried to send the traffic over the DHCP line.
So where is my understanding problem?