I have many machines (physical and virtual) with PF running for years. Few days back I started observing problem on one machine running in headless VirtualBox (if it matters)

kernel: [zone: pf states] PF states limit reached

The problem is there are states inserts but states are never removed (pfctl -s info shows 0 removals)

If I run "pfctl -s state | wc -l" the count is the same as shown by "pfctl -s info | grep inserts". There are thousands of states after 30 minutes.

"netstat -an" show only about 90 connections in WAIT or CLOSED or ESTABLISHED state.

Why PF does not remove all states? What can be wrong on this machine in question?

My current workaround is to restart PF many times a day (or use pfctl -F states)

pf.conf if relatively simple, just a basic rules to allow incomming traffic for TCP services, allowing all outgoing traffic and some "set" options:

set limit { states 200000, frags 5000 }
set limit table-entries 900000
set optimization aggressive
set block-policy drop
set loginterface $ext_if
set skip on $unfiltered

scrub in  on $ext_if
scrub out on $ext_if no-df random-id


And the last question - is there any way to use PF as stateless firewall? PF automatically add "keep state" to all rules, how can I change this behavior to not add "keep state" on all or some rules?

Kind regards
Miroslav Lachman
_______________________________________________
freebsd-pf@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-pf
To unsubscribe, send any mail to "freebsd-pf-unsubscr...@freebsd.org"

Reply via email to