From owner-freebsd-questions@freebsd.org Fri Jan 22 00:58:58 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 B2D854E5F4E for ; Fri, 22 Jan 2021 00:58:58 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DMLVn4vyvz3jSq for ; Fri, 22 Jan 2021 00:58:57 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: by mail-lj1-x232.google.com with SMTP id f17so4629081ljg.12 for ; Thu, 21 Jan 2021 16:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenebras-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ubnTq/Hpr6iHBXUqQnP+m4nfxwvpwwmIzfjrDpXV4m8=; b=pxDSvi91miJTUSB8kpK7Z8vk0LVziPvsWo2sF+L6wxrRXONp//BrtNjjwJb9YAMLXT X3f4ykuxF8EL+NPsLbZ7UOzY6Q1lZU+bU4k/1hExsS/4AG6S49Kw/3d3KkHkLBWK/BOx jqjoCVXsitAuIsmw4ix2P9yqjq8+SxQFJi/59P0HhEVJcZXQaJ1nIxCu/+JTVfLfdVNN 8U/GRQSxM/BmYJ1H4sWp2OwA7FvR1AnFIcZDlJv1gxHD8UNdYGMr1zFu25DJms4zc6np 9yqZKWO2EnQccXeSGYbXtThXUtuTron4wRMaMY7pKWfMCO0hiZerNHO67Owm5twdZggO 4EZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ubnTq/Hpr6iHBXUqQnP+m4nfxwvpwwmIzfjrDpXV4m8=; b=sOO0JKIg0tBTmmK/OyrQSyFoPL2fpNwt63W87K2KmSlzeJ7fPpoinTR07IRYIzYou6 caY99DwCL57P8UnzrsmeqNS60DddbCHbszXZCym/6cKiy4ROWvI7FHR+/+xL5sPBl5hS 4khFa6PfOd+yeoSvQD3EkAOPcEyixnMaBbi7Wj+aFdg5/TZd7fnhDy9uyMloosp15bGb JyNPgb50pYRV3RxbF0rjXaDQohpFiFUYPMgqHZWln2sMKQ+zcZ7OBF3TWcf/aheYlVpU WgS6uhZdJOyn1WFPkVS3dW55xYllbFWOJRjMAhU0laQcb8PW6i6pd2nLGNXFoboeh8Je 5Mlg== X-Gm-Message-State: AOAM531+UjWTQP1RoSZru2WPYzndbloKnAAC/0kaDnFpZbZvbOGgJQf1 5gchdpmSyfq6TlvrXEpbfmUJKZJf2Kf5I8clBGvd+w== X-Google-Smtp-Source: ABdhPJyxriDp+ZBB09NSw9C2O0TF5SwN1idaIXoAzHnXUy0zXL9cc/sP8mhZe8/mN4RvvVgPnz/27QZVMGKG/wmo03I= X-Received: by 2002:a05:651c:87:: with SMTP id 7mr71786ljq.312.1611277135620; Thu, 21 Jan 2021 16:58:55 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Michael Sierchio Date: Thu, 21 Jan 2021 16:58:20 -0800 Message-ID: Subject: Re: IPFW | Too many dynamic rules? To: Jos Chrispijn Cc: FreeBSD Mailing List X-Rspamd-Queue-Id: 4DMLVn4vyvz3jSq X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tenebras-com.20150623.gappssmtp.com header.s=20150623 header.b=pxDSvi91; dmarc=none; spf=none (mx1.freebsd.org: domain of kudzu@tenebras.com has no SPF policy when checking 2a00:1450:4864:20::232) smtp.mailfrom=kudzu@tenebras.com X-Spamd-Result: default: False [-2.30 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[tenebras-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::232:from]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; DMARC_NA(0.00)[tenebras.com]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::232:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[tenebras-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::232:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 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:58:58 -0000 On Thu, Jan 21, 2021 at 4:45 PM Jos Chrispijn wrote: > 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 m= ay > > 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? > It depends. ;-). Near the top. Dynamic rules get checked whenever you reach the check-state, or the first keep-state rule with the same tag (if you don't use a tag, the :default is used). ipfw rulesets can be subtle. More so if nat is involved. > > 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? > I am hesitant to claim that it will solve your problem, but I doubt it can hurt. Yes, those are the values in /etc/sysctl.conf > > 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. > No apologies required or accepted. ;-). This is sometimes an arcane topic. > > Best, Jos > Vell succes! =E2=80=93 M --=20 "Well," Brahm=C4=81 said, "even after ten thousand explanations, a fool is = no wiser, but an intelligent person requires only two thousand five hundred." - The Mah=C4=81bh=C4=81rata