Repository navigation
Description
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
- I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue
Is your feature request related to a problem? Please describe.
We use OPNsense clusters in asymmetric routing scenarios where query packets leave our datacenter via the first cluster node, and response packets flow back via the other node. We rely on the pf state synchronization facility to ensure all connection states created by the first node are replicated to the second node, so that it can accept incoming responses based on firewall states.
In the latest version of OPNsense Community, such a scenario leads to a race condition: response packets almost always hit the second node before state synchronization completes. The second node, finding 0 match in its state database, drops the initial transmit of those packets. It will take some time (and at least 1 retransmit) to have response packets accepted, as state synchronization completed meanwhile.
This behavior can be improved by enabling the defer feature on the pfsync interfaces of our firewalls, which ensures a connection state is replicated before allowing a connection. When this flag is on, the issue I just described disappears.
Describe the solution you like
Please, add a checkbox in the System / High Availability / Settings page:
- Name: Defer packet transmission until state sync
- Description (from the
ifconfig(8)man page):Defer transmission of the first packet in a state until a peer has acknowledged that the associated state has been inserted.
Ensure the OPNsense framework configures the pfsync(4) interface accordingly:
- When the checkbox is checked, the
deferflag must be present:
ifconfig pfsync0 defer - When the checkbox is unchecked, the
deferflag must be absent:
ifconfig pfsync0 -defer
Describe alternatives you considered
Currently, we use a custom cron job to enable the defer feature flag.
Additional context
None.
Activity
AdSchellevis commentedon Sep 25, 2025
some more context about the
deferflag:https://undeadly.org/cgi?action=article;sid=20090619100514
https://www.openbsd.org/faq/pf/carp.html
In some cases this can be practical indeed, I'll see if we can put this on the roadmap for 26.1
System: High Availability: Settings - add pfsync defer option (defaul…
bernardm-aca commentedon Oct 8, 2025
Thank you!