https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217997
--- Comment #5 from Max ---
Well, I can reproduce the problem.
I have 3 hosts with 10.3 release (generic kernel). "Server", "client" and
"firewall".
Complete pf.conf of "firewall" host:
set skip on {lo, em2}
table persist { 192.168.0.10, 192.168.0.20, 192.168.0.30 }
rdr proto tcp from any to 192.168.2.1 port http -> port http \
round-robin sticky-address
block in all
block out all
pass quick proto tcp from any to port 80 \
keep state \
(source-track rule, max 120, max-src-states 96, \
tcp.closing 20, tcp.finwait 15, tcp.closed 10)
It works as expected until we hit the "max states per rule" limit. For example
(just counters):
# pfctl -vsi
Status: Enabled for 0 days 00:17:46 Debug: Urgent
State Table Total Rate
current entries 20
searches 3450.3/s
inserts 400.0/s
removals 200.0/s
Source Tracking Table
current entries 20
searches 800.1/s
inserts 400.0/s
removals 200.0/s
# pfctl -vsi
Status: Enabled for 0 days 00:18:05 Debug: Urgent
State Table Total Rate
current entries0
searches 3450.3/s
inserts 400.0/s
removals 400.0/s
Source Tracking Table
current entries 20
searches 800.1/s
inserts 400.0/s
removals 200.0/s
# pfctl -vsi
Status: Enabled for 0 days 00:18:16 Debug: Urgent
State Table Total Rate
current entries0
searches 3450.3/s
inserts 400.0/s
removals 400.0/s
Source Tracking Table
current entries0
searches 800.1/s
inserts 400.0/s
removals 400.0/s
But when I reach the limit:
# pfctl -vsi
Status: Enabled for 0 days 00:04:46 Debug: Urgent
State Table Total Rate
current entries1
searches16275.7/s
inserts 2030.7/s
removals 2020.7/s
Source Tracking Table
current entries 10
searches 3331.2/s
inserts 400.1/s
removals 300.1/s
Limit Counters
max states per rule90.0/s
max-src-states 00.0/s
max-src-nodes 00.0/s
max-src-conn 00.0/s
max-src-conn-rate 00.0/s
overload table insertion 00.0/s
overload flush states 00.0/s
# pfctl -ss
all tcp 192.168.0.10:80 (192.168.2.1:80) <- 192.168.2.14:15122
CLOSED:SYN_SENT
# pfctl -sS
192.168.2.17 -> 192.168.0.10 ( states 1, connections 0, rate 0.0/0s )
192.168.2.15 -> 192.168.0.20 ( states 1, connections 0, rate 0.0/0s )
192.168.2.14 -> 192.168.0.10 ( states 1, connections 0, rate 0.0/0s )
192.168.2.14 -> 0.0.0.0 ( states 1, connections 0, rate 0.0/0s )
192.168.2.13 -> 192.168.0.30 ( states 1, connections 0, rate 0.0/0s )
192.168.2.11 -> 192.168.0.10 ( states 1, connections 0, rate 0.0/0s )
192.168.2.12 -> 192.168.0.20 ( states 1, connections 0, rate 0.0/0s )
192.168.2.16 -> 192.168.0.30 ( states 1, connections 0, rate 0.0/0s )
192.168.2.18 -> 192.168.0.20 ( states 1, connections 0, rate 0.0/0s )
192.168.2.10 -> 192.168.0.30 ( states 1, connections 0, rate 0.0/0s )
# pfctl -vsi
Status: Enabled for 0 days 00:08:19 Debug: Urgent
State Table Total Rate
current entries0
searches16273.3/s
inserts 2030.4/s
removals 2030.4/s
Source Tracking Table
current entries8
searches 3330.7/s
inserts 400.1/s
removals