From owner-freebsd-pf@freebsd.org Thu Jun 14 20:22:59 2018 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ED291000FD0 for ; Thu, 14 Jun 2018 20:22:59 +0000 (UTC) (envelope-from SRS0=8dHG=JA=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0ACF7FEAA for ; Thu, 14 Jun 2018 20:22:58 +0000 (UTC) (envelope-from SRS0=8dHG=JA=quip.cz=000.fbsd@elsa.codelab.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 4009828450; Thu, 14 Jun 2018 22:22:57 +0200 (CEST) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 0328E28459; Thu, 14 Jun 2018 22:22:55 +0200 (CEST) Subject: Re: Is there an upper limit to PF's tables? To: Ian FREISLICH , Dave Horsfall , FreeBSD PF List References: <41eb69f5-a2ba-7546-f7c8-b97eb179d22e@quip.cz> From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <284a180b-6247-1bd5-d683-1e704b601628@quip.cz> Date: Thu, 14 Jun 2018 22:22:55 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2018 20:22:59 -0000 Ian FREISLICH wrote on 2018/06/14 22:03: > On 06/14/2018 03:44 PM, Miroslav Lachman wrote: >> # service pf reload >> Reloading pf rules. >> /etc/pf.conf:37: cannot define table reserved: Cannot allocate memory >> /etc/pf.conf:38: cannot define table czech_net: Cannot allocate memory >> /etc/pf.conf:39: cannot define table goodguys: Cannot allocate memory >> /etc/pf.conf:40: cannot define table badguys: Cannot allocate memory >> /etc/pf.conf:41: cannot define table tor_net: Cannot allocate memory >> pfctl: Syntax error in config file: pf rules not loaded >> >> Even if there is "set limit table-entries 300000" >> >> I do not understand PF internals but I think PF needs twice the memory >> for reload (if there are already a lot of entries). >> Because workaround for this was simple as reload PF with empty table >> and then load table entries: > > Did you try setting the table limit to 500000?  I believe that PF does a > copyin from pfctl essentially building the new inactive ruleset and > switching to it at commit.  This would result in the twice memory > requirement you're seeing.  It has been a long long time for me so I've > probably not explained correctly. No I didn't tried anything above 300000 but I will try it next time. (maybe 600000) Miroslav Lachman