OPNsense Forum

English Forums => General Discussion => Topic started by: TomT on April 10, 2021, 03:26:17 pm

Title: Traffic Shaping
Post by: TomT on April 10, 2021, 03:26:17 pm
Hello

I'm coming from pfSense where I use limiters and schedules.

My son children has an xboxone and I currently have a limiter configured to restrict the bandwidth he uses.
He has found this has stopped him getting lag and buffering.  Is there anyway to do this and only apply it to one or two IP Addresses ( alias list ) ?

My other son, has a NAS drive which he uses to backup uni work. I have a limiter running on a schedule to restrict how much bandwidth it uses during the day, and then allow it full bandwidth at night. So 0800 - 2300 it is limited outside of that its not.

Is there anyway to do this ?

Thanks
Title: Re: Traffic Shaping
Post by: packet loss on April 10, 2021, 08:08:09 pm
OPNsense does have traffic shaping which will help with bufferbloat.

https://docs.opnsense.org/manual/shaping.html

shaper -> pipes | queues | rules

Under the rules tab you can specify IP addresses or subnets.
Title: Re: Traffic Shaping
Post by: Inxsible on April 10, 2021, 09:54:57 pm
I have tried Traffic Shaping but for me it has not made much of a difference. My bufferbloat is at B -- when I use the ISP gateway and at D when I use my VPN gateway.

No matter how many tweaks I made, it stayed at D -- maybe giving C a couple of times. Then again I have a 100/5 line from Comcast (who else!!!)

So if you are using VPNs etc, you may or may not see improvements. Just posting here to see if I can gain more insights about Traffic shaping.
Title: Re: Traffic Shaping
Post by: mimugmail on April 11, 2021, 07:09:30 am
Regarding the shaping on daytime this is not possible. You can only use schedules for pfrules, not shaping.
Maybe just block the connection over the day and allow at night?
Title: Re: Traffic Shaping
Post by: TomT on April 11, 2021, 12:09:37 pm
Thanks for the replies.

So there is no way to restrict a devices bandwidth at certain times ?

I have OPT3 which is in 172.1.1.x range the only device on this interface is a NAS 172.1.1.100
I'm happy to do this on the device or that entire interface, but between 0800 - 2300 I need it to use less bandwidth.

Thanks
Title: Re: Traffic Shaping - possible API use ?
Post by: TomT on April 11, 2021, 07:02:12 pm
I've had an idea about this.

Could I use a cronjob and API command to enable / disable the rules as I need ?
So at 0800 Enable the 2 rules that restricts the devices bandwidth, then at 2300 disable the 2 rules.

The following API commands seem to toggle the rule:

Enable
Code: [Select]
https://IP_ADDRESS/api/trafficshaper/settings/toggleRule/RULE_UUID" -d "1"

Disable
Code: [Select]
https://IP_ADDRESS/api/trafficshaper/settings/toggleRule/RULE_UUID" -d "0"

But how to apply them ?
This seems to work, but is that the correct way ?

Code: [Select]
https://IP_ADDRESS/api/trafficshaper/service/flushreload" -d ""
Thanks
Title: Re: Traffic Shaping
Post by: Antaris on April 12, 2021, 07:07:46 pm
I definitely miss something like Cake/SQM QoS in OPNsense.
Title: Re: Traffic Shaping
Post by: mimugmail on April 12, 2021, 07:40:09 pm
https://www.reddit.com/r/opnsense/comments/mpaydz/console_shows_bump_sched_buckets_to_256_was_0/

Script for time schedule
Title: Re: Traffic Shaping
Post by: TomT on April 13, 2021, 09:28:00 am
https://www.reddit.com/r/opnsense/comments/mpaydz/console_shows_bump_sched_buckets_to_256_was_0/

Script for time schedule

Thanks, that looks like it will help.