Shared bandwidth between two local subnets

I have 8Mbit symmetric internet connection, I want to share this between two subnets on my router (two subnets represent 2 different business tenants using the internet connection).

One subnet should be able to use the full 8Mbit if the other is not using it.

If both are downloading big files for example, should not use more than 4Mbit per subnet.

Subnet 1: 192.168.1.0/24
Subnet 2: 192.168.2.0/24

I had a consultant set this up using simple queues, but it never worked properly, this would happen:

Subnet 1:
User 1 192.168.1.1 2Mbit
User 2 192.168.1.2 2Mbit
User 3 192.168.1.3 2Mbit

Subnet 2:
User 1 192.168.2.1 2Mbit

But I want this to happen:

Subnet 1:
User 1 192.168.1.1 )
User 2 192.168.1.2 ) 4 MBit shared
User 3 192.168.1.3 )

Subnet 2:
User 1 192.168.2.1 4Mbit

If there are no users on Subnet 2, or a small few using very low bandwidth, the spare bandwidth should be used by Subnet 1.

Subnet 2:
User 1 192.168.2.1 Downloading from a slow site, using only 0.5Mbps

Therefore, allowing…

Subnet 1:
User 1 192.168.1.1 )
User 2 192.168.1.2 ) 7.5 MBit shared
User 3 192.168.1.3 )

Is this possible using simple queues?

I did it using Queue Tree (share bandwidth of 2 WAN between 24 VLAN).
Your situation is easier.
My example.

Thanks, I have wrote a config based on yours, but marked packets in mangle using ‘src address’ instead of ‘in interface’ and ‘dst address’ instead of ‘out interface’ with my subnets. (and using only 1 WAN)

It seems to be working, but I am struggling to test bandwidth if just one 1 subnet are using the internet connection. as I am working on a live environment in a busy office. If only 1 of your vlans are using the internet connection, can they use all 75M down and 15M up?

Thanks

exactly, the alone vlan can use the full bandwidth of internet.
upd: I was guided this manual, but it is russian.

Thanks, Google translation helped a lot :slight_smile: