From nobody Sun Jul 13 21:05:10 2025 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bgHyx486gz61Tgq for ; Sun, 13 Jul 2025 21:05:13 +0000 (UTC) (envelope-from chris@cretaforce.gr) Received: from smtp1.cretaforce.gr (smtp1.cretaforce.gr [5.75.211.174]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits)) (Client CN "*.cretaforce.gr", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bgHyx2bXZz3DlK for ; Sun, 13 Jul 2025 21:05:13 +0000 (UTC) (envelope-from chris@cretaforce.gr) Authentication-Results: mx1.freebsd.org; none Received: from server1.cretaforce.gr (server1.cretaforce.gr [94.130.217.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) client-signature RSA-PSS (2048 bits)) (Client CN "*.cretaforce.gr", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by smtp.cretaforce.gr (Postfix) with ESMTPS id 3137B20A90 for ; Mon, 14 Jul 2025 00:05:15 +0300 (EEST) Received: from smtpclient.apple (unknown [149.210.77.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: chris@cretaforce.gr) by server1.cretaforce.gr (Postfix) with ESMTPSA id 7B92410396; Mon, 14 Jul 2025 00:05:11 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cretaforce.gr; s=cretaforce; t=1752440708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=AEBA4xhHSGprY/hj6RtVL5n1pmFMjO3bqaXr5PHelMo=; b=jnTo/2+0L/VGMN2lhbU48KfxJ/LMKPASXU1CgF+nbEzRSUWPWTOyYsg0T2WpEaz+f+Urj/ VBfRRVpMT3tXXKAj8UNKDXyNVSc3BsmLAh988IDStvPDeh/4hv9D7wSTi9enx4BqZZ3pcz nKkgdq8FhoLeBSl4XUgZeRUZc1dJff4= From: Christos Chatzaras Message-Id: <63B90A81-5E73-43E3-B36B-788C35ABF798@cretaforce.gr> Content-Type: multipart/alternative; boundary="Apple-Mail=_17E48C32-EDDB-48E6-8A86-55A80E110E36" List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.600.51.1.1\)) Subject: Re: Issues with IPFW skipto Rule and Whitelisting Logic Date: Mon, 14 Jul 2025 00:05:10 +0300 In-Reply-To: Cc: freebsd-net , FreeBSD Questions Mailing List To: Michael Sierchio References: <3A01EF48-EBE8-48C3-9C66-6A250A240341@cretaforce.gr> X-Mailer: Apple Mail (2.3826.600.51.1.1) X-Rspamd-Queue-Id: 4bgHyx2bXZz3DlK X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:5.75.128.0/17, country:DE] --Apple-Mail=_17E48C32-EDDB-48E6-8A86-55A80E110E36 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 13 Jul 2025, at 23:55, Michael Sierchio wrote: >=20 > I haven't had a chance to read this in detail, but=20 >=20 > what about UDP? Most DNS traffic is UDP. >=20 > And these lines are subtly wrong: >=20 > $cmd 10031 allow tcp from me to any dst-port 443 out via $pif setup = keep-state > $cmd 10033 allow tcp from any to me dst-port 443 in via $pif setup = keep-state >=20 > because 'via' causes these rules to catch packets twice as they're = processed by the kernel. IMHO these should be >=20 > $cmd 10031 allow tcp from me to any dst-port 443 out xmit $pif setup = keep-state > $cmd 10033 allow tcp from any to me dst-port 443 in recv $pif setup = keep-state >=20 > I'll have more comments when I get a chance to peruse fully. I left out unrelated lines to keep my question focused. For DNS traffic, I have: $cmd 10021 allow tcp from any to me dst-port 53 in via $pif setup = keep-state $cmd 10022 allow udp from any to me dst-port 53 in via $pif keep-state $cmd 10023 allow tcp from me to any dst-port 53 out via $pif setup = keep-state $cmd 10024 allow udp from me to any dst-port 53 out via $pif keep-state I=E2=80=99ll look into using xmit/recv as you suggested. Thanks for the = tip.= --Apple-Mail=_17E48C32-EDDB-48E6-8A86-55A80E110E36 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On 13 Jul = 2025, at 23:55, Michael Sierchio <kudzu@tenebras.com> = wrote:

I haven't had a chance to read this in detail, but =

what about UDP?  Most DNS traffic is UDP.

And these = lines are subtly wrong:

$cmd 10031 allow tcp from me to any = dst-port 443 out via $pif setup keep-state
$cmd 10033 allow tcp from = any to me dst-port 443 in via $pif setup = keep-state

because 'via' causes these = rules to catch packets twice as they're processed by the kernel.  = IMHO these should be

$cmd 10031 allow tcp from me to any dst-port = 443 out xmit $pif setup keep-state
$cmd 10033 allow tcp from any to = me dst-port 443 in recv $pif setup = keep-state

I'll have more comments when I = get a chance to peruse fully.

I left out unrelated lines to keep my = question focused.

For DNS traffic, I = have:

$cmd 10021 allow tcp from any to me dst-port 53 in via $pif = setup keep-state
$cmd 10022 allow udp from any to me dst-port 53 in = via $pif keep-state
$cmd 10023 allow tcp from me to any dst-port 53 = out via $pif setup keep-state
$cmd 10024 allow udp from me to any = dst-port 53 out via $pif keep-state

I=E2=80=99ll look into using = xmit/recv as you suggested. Thanks for the = tip.
= --Apple-Mail=_17E48C32-EDDB-48E6-8A86-55A80E110E36--