Internet balancing between two interfaces

Hi,
I have my ISP on ether1, local LAN + WiFi on bridge1 and a “guest” network on ether5.
I want to share Internet connection between bridge1 and ether5 giving priority to users on bridge1. I mean, if no one is connected to the bridge, users on ether5 can use the whole bandwidth.
In case two users are connected (one on bridge1 and the other one on ether5), user on bridge1 must have priority on user on ether5.
I’ve tried to implement that using queue tree and mangle, but I’ve some doubts.
What’s the best solution? Can someone provide some example?

Many thanks

There is no other solution than queues.

With queue tree, you’d use a parent queue for each direction (upload/download) common for both bridge and ether5 (so you cannot use the interface as the parent for the download queues), and two queues per direction (so you need to assign distinct packet-mark values in mangle for ether5 download and bridge download). The parent queue has both limit-at and max-limit set to the available bandwidth; the child queue for bridge has both limit-at and max-limit set to the available bandwidth too, whereas the child queue for ether5 has limit-at set to something like 1 Mbit/s and max-limit to the available bandwidth. The queue for bridge has higher priority than the queue for ether5. That should be enough.

According to the manual, it should be enough to specify limit-at to the available bandwidth for the /queue simple with target set to the subnet used on the bridge (which must differ from the subnet used on ether5) - so no mangling, no packet marks necessary, just a single row in /queue simple. But I’ve never tried this.