From nobody Mon Aug 2 08:38:06 2021 X-Original-To: freebsd-ipfw@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 9E5E212B98D3 for ; Mon, 2 Aug 2021 08:38:17 +0000 (UTC) (envelope-from alfadev@protonmail.com) Received: from mail-40137.protonmail.ch (mail-40137.protonmail.ch [185.70.40.137]) (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 "protonmail.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GdWc81DSWz3Jlw for ; Mon, 2 Aug 2021 08:38:16 +0000 (UTC) (envelope-from alfadev@protonmail.com) Date: Mon, 02 Aug 2021 08:38:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1627893487; bh=L5SleSfgyfmSt4sb9l2xxwLG+8/wwgISEHqHdtltQbw=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=d7cGl2MNOdhx24ZsV6tISiprQy3gi7UztIiSyylt7P1Ij2XUGJ9lrPcGusrtq91wy Wi/1HF2HxsLuqARaGytUyB71c3PyejRZXQ0JXn2AR4iaQdS2KRcYcn9mm3ZOp5cYIi lGpfV24+em3AB5vS7P9jOTyW4zfYVAXKm4ZLZBr0= To: Martin Beran Cc: "freebsd-ipfw@FreeBSD.org" , "freebsd-hackers@FreeBSD.org" Reply-To: alfadev Subject: Re: How to Force Packet Traversal Order (IPFW2 => PF) Message-ID: In-Reply-To: References: List-Id: IPFW Technical Discussions List-Archive: https://lists.freebsd.org/archives/freebsd-ipfw List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ipfw@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Rspamd-Queue-Id: 4GdWc81DSWz3Jlw X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=protonmail.com header.s=protonmail header.b=d7cGl2MN; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (mx1.freebsd.org: domain of alfadev@protonmail.com designates 185.70.40.137 as permitted sender) smtp.mailfrom=alfadev@protonmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; HAS_REPLYTO(0.00)[alfadev@protonmail.com]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[protonmail.com]; R_SPF_ALLOW(-0.20)[+ip4:185.70.40.0/24]; RWL_MAILSPIKE_GOOD(0.00)[185.70.40.137:from]; DKIM_TRACE(0.00)[protonmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[protonmail.com,quarantine]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[protonmail.com]; ASN(0.00)[asn:62371, ipnet:185.70.40.0/24, country:CH]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[protonmail.com:s=protonmail]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[protonmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MAILMAN_DEST(0.00)[freebsd-ipfw] Reply-To: alfadev@protonmail.com From: alfadev via freebsd-ipfw X-Original-From: alfadev X-ThisMailContainsUnwantedMimeParts: N Thank you all , I made further research and found same issue (Multi WAN + Captive Portal no= t working when pf+ipfw enabled same time) on OPNSENSE first mention is here: https://github.com/opnsense/core/issues/1166 here is the OPNSENSE solution: https://git.furworks.de/opensourcemirror/opnsense-src/commit/83fd8a61b942d8= 4f553e53127c4be02b318f7cf4 https://reviews.freebsd.org/D8109 https://reviews.freebsd.org/D8109 i will try solutions above links and hope this helps me and others.. =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Sunday, August 1st, 2021 at 1:19 AM, Martin Beran wrote= : > p=C3=A1 30. 7. 2021 v 13:41 odes=C3=ADlatel alfadev via freebsd-ipfw < > > freebsd-ipfw@freebsd.org> napsal: > > > Hi, > > > > I have to use both IPFW and PF sametime in my freebsd 12.2 gateway > > > > According to my observations firewalls are following this order all of = my > > > > scenarios PF =3D> IPFW2. I see this exactly When i use PF's route-to op= tion . > > > > When i create Load-Balancing rule using PF's route-to, packets not ente= ring > > > > into IPFW. So when i made PBR, IPFW rules like mac based piping, bandwi= dth, > > > > captive portal etc. does not works. > > > > So that > > > > i am trying to do this order: > > > > input =3D> ipfw =3D> pf > > > > but i think i cannot change this order without touching kernel level . > > > > when i made some research i found this > > > > https://www.opennet.ru/tips/info/1431.shtml > > I think that you do not need to touch kernel source, nor build a custom > > kernel. The order of calling packet filtering modules depends on the orde= r > > of registering the modules to packet processing hooks. Instead of loading > > the modules by their respective startup scripts, you can load them in the > > required order by including them in /etc/rc.conf in variable kld_list. I = do > > not remember if the order of calling is the same or the opposite of the > > order of module loading. > > Martin Beran