From owner-freebsd-pf@freebsd.org Fri Aug 25 12:47:37 2017 Return-Path: Delivered-To: freebsd-pf@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5AF5DD7D05 for ; Fri, 25 Aug 2017 12:47:37 +0000 (UTC) (envelope-from 000.fbsd@quip.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 ABE2282 for ; Fri, 25 Aug 2017 12:47:33 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 29B1A28429 for ; Fri, 25 Aug 2017 14:41:48 +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 6E94E28423 for ; Fri, 25 Aug 2017 14:41:47 +0200 (CEST) To: freebsd-pf@FreeBSD.org From: Miroslav Lachman <000.fbsd@quip.cz> Subject: PF cannot allocate memory on reload Message-ID: <59A01B0A.6050407@quip.cz> Date: Fri, 25 Aug 2017 14:41:46 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 25 Aug 2017 12:47:38 -0000 I have PF rules with some large tables. The biggest one is with Tor IPs - 198239 entries in table tor_net. When I try to reload PF I get error like these: /etc/pf.conf.tmp:37: cannot define table reserved: Cannot allocate memory table persist file "/etc/pf.czech_net.table" /etc/pf.conf.tmp:38: cannot define table czech_net: Cannot allocate memory table persist file "/etc/pf.goodguys.table" /etc/pf.conf.tmp:39: cannot define table goodguys: Cannot allocate memory table persist file "/etc/pf.badguys.table" /etc/pf.conf.tmp:40: cannot define table badguys: Cannot allocate memory table persist file "/etc/pf.tor_net.table" table persist table persist set limit table-entries 300000 set block-policy drop set loginterface em1 set skip on { lo0 xyz1 } pfctl: Syntax error in config file: pf rules not loaded The possible workaround is to flush table tor_net, reload PF and then add IPs to the table tor_net. Is there something I can tune to prevent these errors? This is on FreeBSD 10.3-RELEASE-p18 amd64 GENERIC Miroslav Lachman