From owner-freebsd-pf@freebsd.org Thu Oct 15 08:51:42 2020 Return-Path: Delivered-To: freebsd-pf@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 9683B437B4B for ; Thu, 15 Oct 2020 08:51:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBjgy3Xd2z4Dgn; Thu, 15 Oct 2020 08:51:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 412862A1B6; Thu, 15 Oct 2020 08:51:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id D78523CBAE; Thu, 15 Oct 2020 10:51:40 +0200 (CEST) From: "Kristof Provost" To: "J David" Cc: "Andreas Longwitz" , freebsd-pf@freebsd.org Subject: Re: Packets passed by pf don't make it out? Date: Thu, 15 Oct 2020 10:51:37 +0200 X-Mailer: MailMate (1.13.2r5673) Message-ID: In-Reply-To: References: <5F8336C7.5020709@incore.de> <5F84CF18.1040905@incore.de> <0072D8A9-6ACE-47D0-AE94-124C4F955735@FreeBSD.org> <66EA3FE1-598F-4D42-8464-5A3A5C75CD07@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.33 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, 15 Oct 2020 08:51:42 -0000 On 14 Oct 2020, at 21:35, J David wrote: > On Wed, Oct 14, 2020 at 3:20 PM Kristof Provost > wrote: >> I’ve not dug very deep yet, but I wonder if we shouldn’t have to >> teach pf to change the source port to avoid conflicting states in the >> first place. > > That was my first thought as well, framed mentally as some sort of > port-only Frankenstein's binat because my level of understanding is > clearly more cartoonish than yours. ;-) > > My second thought was to wonder if my approach is architecturally > wrong. Would it make sense for the many-to-many case to use route-to > instead of rdr, leave the packet unmodified, and expect every machine > in the server pool to catch all the public IPs? > > That might still be tricky. Using rdr would presumably hit the same > problem. Maybe something gross like ifconfig'ing the public pool > addresses as /32's on lo0, then binding on those, maybe? > I honestly don’t know. The pf NAT/RDR/… code is complex, and I certainly don’t understand all edge cases. It may be worth experimenting with such options though, because this is unlikely to be fixed short-term. Best regards, Kristof