From nobody Sun Jun 04 00:14:24 2023 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 4QYcgN6Q2bz4ZDVy for ; Sun, 4 Jun 2023 00:14:40 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from prime.gushi.org (prime.gushi.org [IPv6:2620:137:6000:10::142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "prime.gushi.org", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QYcgM33Z4z3GrK for ; Sun, 4 Jun 2023 00:14:39 +0000 (UTC) (envelope-from freebsd@gushi.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gushi.org header.s=prime2014 header.b=Dnoc5dmb; spf=pass (mx1.freebsd.org: domain of freebsd@gushi.org designates 2620:137:6000:10::142 as permitted sender) smtp.mailfrom=freebsd@gushi.org; dmarc=pass (policy=none) header.from=gushi.org Received: from smtpclient.apple (vpn-us.f.root-servers.org [149.20.8.9]) (authenticated bits=0) by prime.gushi.org (8.16.1/8.16.1) with ESMTPSA id 3540EZNC000560 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 3 Jun 2023 17:14:36 -0700 (PDT) (envelope-from freebsd@gushi.org) DKIM-Filter: OpenDKIM Filter v2.10.3 prime.gushi.org 3540EZNC000560 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gushi.org; s=prime2014; t=1685837677; bh=aB4ePXdqr/H9o4pnA2FozPolIrQE9A20viFYKhT2mEs=; h=From:Date:Subject:To; z=From:=20"Dan=20Mahoney=20(Ports)"=20|Date:=20S at,=203=20Jun=202023=2020:14:24=20-0400|Subject:=20Odd=20ipfw=20be havior=20with=20UDP=20query=20on=20the=20same=20host|To:=20freebsd -ipfw@freebsd.org; b=Dnoc5dmbkbLNyiHJZGVP1Jb+d1lilYKA6P3CeKYfeo/C/fpkER6xmZ6uqeUXhvrgc SvcwOLIrAiMhl+enWF/NMCZ4RUYSown+pJF4Kf+GSeKtkOoO6Pl6PF9XDILE6iNEoa nwidoQGfesp8Ysi2c4qojjoEHpfG9kJ6QoiVVqV2VGAWYgWgR7vwfoCjvcqa1buaPd Wkf+z/XOedLeYP6ZHDWfeFE8CD/Gbs7e6UwCSN3YLOss8j1itOCylMlXJsu8HXqsHY Lz1PoXtqplF8gpr7wWB3xbMdb8n7MvvM8ir+tZXmamZA/1GE4yselgGSQLSmJ7O1ab P1s2dCt/2q1LA== X-Authentication-Warning: prime.gushi.org: Host vpn-us.f.root-servers.org [149.20.8.9] claimed to be smtpclient.apple From: "Dan Mahoney (Ports)" Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (Mac OS X Mail 16.0 \(3731.600.7\)) Date: Sat, 3 Jun 2023 20:14:24 -0400 Subject: Odd ipfw behavior with UDP query on the same host Message-Id: <2E42F91E-E751-45D9-8792-41337334F11F@gushi.org> To: freebsd-ipfw@freebsd.org X-Mailer: Apple Mail (2.3731.600.7) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (prime.gushi.org [149.20.68.142]); Sun, 04 Jun 2023 00:14:37 +0000 (UTC) X-Spamd-Result: default: False [-6.17 / 15.00]; DWL_DNSWL_MED(-2.00)[gushi.org:dkim]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.97)[-0.974]; MV_CASE(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gushi.org,none]; R_DKIM_ALLOW(-0.20)[gushi.org:s=prime2014]; RCVD_IN_DNSWL_MED(-0.20)[2620:137:6000:10::142:from]; R_SPF_ALLOW(-0.20)[+a:prime.gushi.org]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BLOCKLISTDE_FAIL(0.00)[149.20.8.9:server fail,2620:137:6000:10::142:server fail]; MLMMJ_DEST(0.00)[freebsd-ipfw@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; HAS_XAW(0.00)[]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[gushi.org:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:393507, ipnet:2620:137:6000::/44, country:US]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4QYcgM33Z4z3GrK X-Spamd-Bar: ------ X-ThisMailContainsUnwantedMimeParts: N Hey ipfw folks =E2=80=94 Im skipping questions@ and asking this directly = here, FreeBSD 12.4 (amd64) Assume a partial firewall ruleset like this: 00300 0 0 allow ip from any to any via lo0 00400 0 0 allow ip from any to any via lo1 00500 0 0 deny ip from any to 127.0.0.0/8 in 00600 0 0 deny ip from any to ::/64 in 01600 1 174 allow ip from any to me 53 in // DNS queries 01700 1 293 allow ip from me 53 to any out // DNS responses 03000 0 0 reset log ip from any to any 65535 0 0 allow ip from any to any For some reason, with the above, I=E2=80=99m able to query a DNS server = living on my own (public) ipv6 interface, i,e: dig @2001:b00b:6b:2::53 version.bind CH TXT: ;communications error to 2001:b00b:6b:2::53#53: timed out This is not a bind config problem. Bind answers from outside and = everywhere else but itself. =3D=3D If I change rule 1600 to simply be "allow ip from any to me 53=E2=80=9D = it works. =20 If I do ipfw disable firewall it works. =20 Localhost always works. Using the ipv4 address works. =3D=3D It=E2=80=99s only when using an ipv6 interface ip on the same box that = this breaks. TCP also works, this only seems to be a UDP issue. My best guess is something about the =E2=80=9Cinbound/outbound=E2=80=9D = determination logic is weird in ipv6. My log rule shows:=20 Jun 3 23:44:35 box kernel: ipfw: 3000 Deny UDP [2001:b00b:6b:2::53]:53 = [2001:b00b:6b:2::53]:26588 in via em0 Jun 3 23:44:40 box kernel: ipfw: 3000 Deny UDP [2001:b00b:6b:2::53]:53 = [2001:b00b:6b:2::53]:32389 in via em0 ipv4 doesn=E2=80=99t show this problem. Subnet masks and the like are = correct. Any ideas? -Dan=