Share internet bandwidth amongst users UN-evenly

Started by GiantJack, April 23, 2021, 11:12:05 AM

Previous topic - Next topic
April 23, 2021, 11:12:05 AM Last Edit: April 23, 2021, 11:30:29 AM by GiantJack
Hi!

I would like to make my full WAN bandwidth available to some devices when it's available, but I want to create priority when it's overloaded.

Here is an example of situation:
- My work laptop shall have full priority & bandwidth when using it.
- My TV steam shall have less priority than laptop but more than my NAS
- My NAS shall have lowest priority: ie sync backups in background when I sleep (no laptop, no TV).

Can I use this howto: https://docs.opnsense.org/manual/how-tos/shaper_share_evenly.html

but with following modifications to make it 'unevenly' :

1- create more queues, with different weight:  say 100 for work laptop, 50 for TV, 5 for NAS.
ex: "QueueUp-1Mbps_100", "QueueUp-1Mbps_50",  "QueueUp-1Mbps_5"
2- create rules for each device and use IP address of the device for source (UL) and dest (DL) ?
ex:  "ShapeUpload_NAS" shall have source as 192.168.2.65 if it's my NAS IP ?

Would this make the job ?

And then:  how can I set a "default" weight for other devices that are not managed in a rules?
Can I set a default rules "192.168.2.0/24" at the bottom of the list?


One day, I will understand all of this !

April 24, 2021, 12:19:59 PM #1 Last Edit: April 25, 2021, 05:38:41 PM by GiantJack
Seems not working:

Currently my NAS weight 5  take 99.9% of bandwidth (download) while my laptop have to deal with 0.1% (weighted 80).

Percentages comes from firewall/shaper/status
One day, I will understand all of this !

April 25, 2021, 05:28:39 PM #2 Last Edit: April 25, 2021, 05:37:36 PM by GiantJack
Hi!
After re-read a bit more the document, I thought it may be better to re-use somewhat the howto with weighted queues here:
https://docs.opnsense.org/manual/how-tos/shaper_prioritize_using_queues.html

I tried a simple test:

Pipe: 10Mbps (~my DSL max DL speed):


Then, I added a couple of queues, with weight 1 & 9 (tried 1 & 100, no difference).




And the rules:




My expectation is that the devices matching weigth 9 shall have prority and more bandwidth than devices with weight 1.

So I launch a download on 192.168.1.90 using my full bandwidth and with weight 1.

Then, I launch some download on 192.168.1.14 and expected it will take priority...But it's stuck with few kbps while download on 192.168.1.90 is almost not impacted !

Did I do something wrong ?

One day, I will understand all of this !

Finally I found some hope here:
https://forum.opnsense.org/index.php?topic=16181.0

Following japtain.cack suggestion, I doubled my rules, one with "interface WAN", one similar with "Interface WAN/ Interface2 LAN".
It seems to work : I finally was able to drop down the low weight device when needed.
Further tests on going, and screenshot of all rules to come.

Do this workaround make sense ? 
One day, I will understand all of this !

Hi!

I have a similar setup as you and from my tests I did, I would say it's working; I don't need to double the rules (what in my sense makes also no sense, as one data packet can/should only be counted once!).

The only difference I have: in the queues I have specified mask "destination" for download queues and "source" for upload queues. When two clients are downloading the get a 50:50 share and the pipe's limit is not exceeded.

Would be interested about your test results.