From owner-freebsd-questions@freebsd.org Fri Jan 22 00:45:45 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E48FC4E5BA7 for ; Fri, 22 Jan 2021 00:45:45 +0000 (UTC) (envelope-from bsduser@cloudzeeland.nl) Received: from poseidon.cloudzeeland.nl (cloudzeeland.xs4all.nl [83.161.133.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "cloudzeeland.nl", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DMLCY13JPz3hx0 for ; Fri, 22 Jan 2021 00:45:44 +0000 (UTC) (envelope-from bsduser@cloudzeeland.nl) Received: from poseidon.cloudzeeland.nl (cloudzeeland.nl [10.10.10.36]) by poseidon.cloudzeeland.nl (Postfix) with ESMTP id BB446187B9; Fri, 22 Jan 2021 01:45:42 +0100 (CET) Received: from [10.10.10.34] (pion1.rpicloud.nl [82.176.127.71]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by poseidon.cloudzeeland.nl (Postfix) with ESMTPSA id 7F12F187CF; Fri, 22 Jan 2021 01:45:42 +0100 (CET) Subject: Re: IPFW | Too many dynamic rules? To: Michael Sierchio Cc: FreeBSD Mailing List References: From: Jos Chrispijn Organization: Userland rocks! Message-ID: Date: Fri, 22 Jan 2021 01:45:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Rspamd-Queue-Id: 4DMLCY13JPz3hx0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bsduser@cloudzeeland.nl designates 83.161.133.58 as permitted sender) smtp.mailfrom=bsduser@cloudzeeland.nl X-Spamd-Result: default: False [-2.29 / 15.00]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[83.161.133.58:from]; R_SPF_ALLOW(-0.20)[+a]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cloudzeeland.nl]; ARC_NA(0.00)[]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.993]; RCPT_COUNT_TWO(0.00)[2]; SPAMHAUS_ZRD(0.00)[83.161.133.58:from:127.0.2.255]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:3265, ipnet:83.160.0.0/14, country:NL]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2021 00:45:45 -0000 Op 22-1-21 om 1:29 schreef Michael Sierchio: > This is affected by a number of things. You ruleset may be faulty, and you > may be instantiating dynamic rules when a matching state exists. You may > need to separate inbound and outbound traffic in your ruleset. Do you have > a check-state rule early in the ruleset? Yes, I do (half way my ruleset. Should I move that line to the top you mean? > The lifetime of dynamic rules is, by default, way too long. See my values > below. In my world, udp is primarily used for DNS queries. 3 seconds is a > very long time. A short dyn_ack_lifetime relies on keepalives (in SSH, for > example). So I should decrease my numbers, following your's and the issue will be solved? Are these also in your /etc/sysctl.conf? > net.inet.ip.fw.dyn_short_lifetime: 3 > net.inet.ip.fw.dyn_udp_lifetime: 3 > net.inet.ip.fw.dyn_rst_lifetime: 2 > net.inet.ip.fw.dyn_fin_lifetime: 1 > net.inet.ip.fw.dyn_syn_lifetime: 9 > net.inet.ip.fw.dyn_ack_lifetime: 300 > net.inet.ip.fw.dyn_parent_max: 4096 > net.inet.ip.fw.dyn_max: 4096 > net.inet.ip.fw.dyn_buckets: 2048 Nub online, sorry. Best, Jos