OPNsense Forum

English Forums => General Discussion => Topic started by: MagikMark on November 02, 2023, 06:05:43 AM

Title: Tunables
Post by: MagikMark on November 02, 2023, 06:05:43 AM
Hi!

I'm new to opnsense.  I was making entries in the tunables section.  After reboot I noticed that the very same entries were also made in Loader.conf.  Isn't this redundant?  Can I  make the entries in Loader.Local.conf instead?
Title: Re: Tunables
Post by: Patrick M. Hausen on November 02, 2023, 07:02:24 AM
If you make the entries in loader.conf only they will be lost after a reboot. The entire text file configuration of OPNsense is generated from what you enter in the UI. Only UI or API settings are persistent.
Title: Re: Tunables
Post by: franco on November 02, 2023, 07:32:42 AM
It's only redundant for the ones being redundant ;) It's not that easy to follow all changes and not all tunables (loader environment variables) are even known to sysctl and sometimes between FreeBSD releases that also changes.

Of course you can also manually operate /boot/loader.conf.local


Cheers,
Franco
Title: Re: Tunables
Post by: Patrick M. Hausen on November 02, 2023, 07:35:56 AM
Quote from: franco on November 02, 2023, 07:32:42 AM
Of course you can also manually operate /boot/loader.conf.local
While technically correct - I would never argue with @franco ;) - please don't do that. If you do, anyway, these settings will not be part of a configuration backup. So don't come back complaining, later.

Like with TrueNAS everything that can be configured in the UI or API should be configured in the UI or API.
Title: Re: Tunables
Post by: franco on November 02, 2023, 07:36:34 AM
Hehehe, I never said it was a good idea :)


Cheers,
Franco
Title: Re: Tunables
Post by: MagikMark on November 02, 2023, 09:32:05 AM
Thanks guys.  I just moved from the otherside.  Trying to learn things
Title: Re: Tunables
Post by: franco on November 02, 2023, 09:49:08 AM
Don't worry. Questions are good. Some things changed over the years for different reasons.


Cheers,
Franco
Title: Re: Tunables
Post by: MagikMark on November 02, 2023, 10:03:39 AM
Hey Franco,

Can you refer me to a site with lisings of all tunables that are still valid for OPNsense.  Not so sure if what I'm putting are still working

Thanks
Title: Re: Tunables
Post by: Patrick M. Hausen on November 02, 2023, 10:41:51 AM
Documentation that applies to OPNsense:

https://docs.opnsense.org/troubleshooting/performance.html
https://docs.opnsense.org/troubleshooting/hardening.html

Getting a list of all tunables in FreeBSD:
sysctl -a

HTH,
Patrick
Title: Re: Tunables
Post by: MagikMark on November 02, 2023, 12:37:52 PM
Thanks Patrick.

Does it mean if the entry is not found on that list, it has been deprecated
Title: Re: Tunables
Post by: Patrick M. Hausen on November 02, 2023, 01:10:19 PM
If an entry does not exist in the list generated directly on the command line - yes, that means this particular entry does not exist anymore.

The documented list specifically for OPNsense is of course by no means exhaustive but simply tries to cover the two most common areas in which one might want to set certain kernel related parameters differently from the default.
Title: Re: Tunables
Post by: franco on November 02, 2023, 01:19:32 PM
> that means this particular entry does not exist anymore.

Unfortunately that's not true for early boot environment variables such as "hw.uart.console".

Also kernel modules not loaded will also not have their sysctls present.


Cheers,
Franco
Title: Re: Tunables
Post by: MagikMark on November 02, 2023, 08:17:08 PM
Thank you for your thoughts guys.  Greatly appreciated