OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: Hackintosys on May 30, 2022, 05:13:09 pm

Title: [Q] How to set adaptive syncookies
Post by: Hackintosys on May 30, 2022, 05:13:09 pm
Hello friends,

can someone please explain me the lower / higher percentage in the new firewall adaptive snycookies settings?
My state table size on the main opnsense page is usually at lower than 10%.

So if I set the adaptive setting to 90/90 would it mean that snycookies will be only enables if >=90% of the state table is used?


Thanks in advance!
Title: Re: [Q] How to set adaptive syncookies
Post by: franco on June 02, 2022, 11:07:07 am
Hi,

From pf.conf manual:

Code: [Select]
           never     pf will never send syncookie SYNACKs (the default).
           always    pf will always send syncookie SYNACKs.
           adaptive  pf will enable syncookie mode when a given percentage of
                     the state table is used up by half-open TCP connections,
                     as in, those that saw the initial SYN but didn't finish
                     the three way handshake.  The thresholds for entering and
                     leaving syncookie mode can be specified using

                           set syncookies adaptive (start 25%, end 12%)

The wording is a bit more difficult than it should be, but generally the start percentage is the amount of state table entries where syncookies are enabled and the end percentage is when syncookie mode is disabled again.

I'm unsure about 25% and 12% as given in the example, probably something you want is more along 60% and 30% so you still have room to grow in syncookie mode but do not enable to too early.


Cheers,
Franco
Title: Re: [Q] How to set adaptive syncookies
Post by: Hackintosys on June 02, 2022, 08:41:22 pm
Thank you for your support.