WAN load-balance and static LAN route

Previously a have set up WAN load-balance with two ISP, this set up worked with no issues (during standby and failover) for a few years.

Now I want to connect my local network to another local network with a different subnet, as the router between subnets I use MikroTik, I’ve set up appropriate IPs on each of it interface, wipe out all default configurations related to firewall and bridge and now it can route between these two subnets without any restrictions. I’ve set up a static route in my VyOS router, checked routing - I can ping every device on the different subnet. But I can do it only from VyOS cli and not from the other local devices - for some reason when I do it from them I get a reply from my ISP gateway instead, so it looks like WAN load-balance ignores static route or has a higher priority.

I tried to alter the load-balance rule adding the subnet exclude option and created a separate higher priority rule with subnet exclude from load-balance, both of which solved the issue, I can ping devices between subnets successfully. But I can only ping them, I can’t reach MikroTik web interface for example.

When I set up the same static route on the computer everything works as expected, routing works like it should. So the root of the problem is definitely VyOS and its load-balance set up. Please help me figure out what I’m missing in the config.

Here is vyos config:

firewall {
    all-ping enable
    broadcast-ping disable
    config-trap disable
    ipv6-receive-redirects disable
    ipv6-src-route disable
    ip-src-route disable
    log-martians enable
    name WAN_IN {
        default-action drop
        rule 10 {
            action accept
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            state {
                invalid enable
            }
        }
    }
    name WAN_LOCAL {
        default-action drop
        rule 10 {
            action accept
            state {
                established enable
                related enable
            }
        }
        rule 20 {
            action drop
            state {
                invalid enable
            }
        }
    }
    name WAN_OUT {
        default-action accept
    }
    receive-redirects disable
    send-redirects enable
    source-validation disable
    syn-cookies enable
    twa-hazards-protection disable
}
interfaces {
    bridge br0 {
        address 192.168.0.1/24
        member {
            interface eth0 {
            }
            interface eth1 {
            }
        }
    }
    ethernet eth0 {
        hw-id xxx
    }
    ethernet eth1 {
        hw-id xxx
    }
    ethernet eth2 {
        address dhcp
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
            out {
                name WAN_OUT
            }
        }
        hw-id xxx
    }
    ethernet eth3 {
        address dhcp
        firewall {
            in {
                name WAN_IN
            }
            local {
                name WAN_LOCAL
            }
            out {
                name WAN_OUT
            }
        }
        hw-id xxx
    }
    loopback lo {
        address 127.0.0.53/8
    }
}
load-balancing {
    wan {
        enable-local-traffic
        flush-connections
        interface-health eth2 {
            failure-count 5
            nexthop dhcp
            success-count 2
            test 10 {
                resp-time 5
                target 1.1.1.1
                ttl-limit 1
                type ping
            }
        }
        interface-health eth3 {
            failure-count 5
            nexthop dhcp
            success-count 2
            test 10 {
                resp-time 5
                target 1.0.0.1
                ttl-limit 1
                type ping
            }
        }
        rule 10 {
            destination {
                address 1.1.1.1
            }
            inbound-interface lo
            interface eth2 {
                weight 1
            }
            protocol all
        }
        rule 20 {
            destination {
                address 1.0.0.1
            }
            inbound-interface lo
            interface eth3 {
                weight 1
            }
            protocol all
        }
        rule 25 {
            destination {
                address 192.168.88.0/24
            }
            exclude
            inbound-interface br0
        }
        rule 30 {
            failover
            inbound-interface br0
            interface eth2 {
                weight 10
            }
            interface eth3 {
                weight 1
            }
            protocol all
            source {
                address 192.168.0.201-192.168.0.254
            }
        }
        rule 40 {
            failover
            inbound-interface br0
            interface eth2 {
                weight 1
            }
            interface eth3 {
                weight 10
            }
            protocol all
            source {
                address 192.168.0.10-192.168.0.200
            }
        }
        sticky-connections {
            inbound
        }
    }
}
protocols {
    static {
        route 192.168.88.0/24 {
            next-hop 192.168.0.5 {
            }
        }
    }
}

And this is what I got from show ip route

Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup

S>* 0.0.0.0/0 [210/0] via xxx, eth2, weight 1, 10:21:14
  *                   via zzz, eth3, weight 1, 10:21:14
C>* xxx/16 is directly connected, eth2, 10:21:16
C>* zzz/20 is directly connected, eth3, 10:21:18
C>* 192.168.0.0/24 is directly connected, br0, 10:20:55
S>* 192.168.88.0/24 [1/0] via 192.168.0.5, br0, weight 1, 10:20:55

Possible for you to attach a (physical) network drawing of what you want to achieve?

You can use https://draw.io/ (also exists for offline use) to draw and then export as an png which you then upload to this thread.

As ping works, routing seems OK.
Is triangular routing the issue ? Vyos will only see traffic in one direction, so in conntrack, sessions will never reach established state

1 Like

According to the docs VyOS do however support ECMP:

https://docs.vyos.io/en/latest/configuration/system/ip.html#cfgcmd-set-system-ip-multipath-layer4-hashing

https://docs.vyos.io/en/latest/configuration/system/ipv6.html#cfgcmd-set-system-ipv6-multipath-layer4-hashing

It was a bad network design (as shown on top of the drawing) when I have two routers in the same subnet on both ends, so I changed it to the bottom one and now everything works as expected.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.