From owner-freebsd-pf@freebsd.org Mon Dec 2 02:56:45 2019 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 C3DBA1C228E for ; Mon, 2 Dec 2019 02:56:45 +0000 (UTC) (envelope-from vas@sibptus.ru) Received: from admin.sibptus.ru (admin.sibptus.ru [IPv6:2001:19f0:5001:21dc::10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47R8s81hSyz4Xbt for ; Mon, 2 Dec 2019 02:56:43 +0000 (UTC) (envelope-from vas@sibptus.ru) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sibptus.ru; s=20181118; h=Message-ID:Subject:To:From:Date:In-Reply-To; bh=EVG/Vfj7QGtXMt3BkAxReA2XIFGmcNpB2iRbLQS9nHY=; b=EUoOVvWAWAfCfPczU2s04aqMLL tobskR2uw4v5896ynvg4P0EAZTQkJE+0LLb70hS2C0DpHN/PoDPRvFH+Vy9nowi1P94AurXJdJZP/ BhmzzHceH/9pAhmO/5RYQXZ9EfOdWsJ/ltAbtGDwUn3VMkxZQy1SxLrqmxEPSrge/+0g=; Received: from vas by admin.sibptus.ru with local (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1ibbtC-000Po1-Jc for freebsd-pf@freebsd.org; Mon, 02 Dec 2019 09:56:42 +0700 Date: Mon, 2 Dec 2019 09:56:42 +0700 From: Victor Sudakov To: freebsd-pf@freebsd.org Subject: pf's states Message-ID: <20191202025642.GA99174@admin.sibptus.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline X-DKIM-result: pass sibptus.ru User-Agent: Mutt/1.12.2 (2019-09-21) X-Rspamd-Queue-Id: 47R8s81hSyz4Xbt X-Spamd-Bar: -------- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=sibptus.ru header.s=20181118 header.b=EUoOVvWA; dmarc=pass (policy=none) header.from=sibptus.ru; spf=pass (mx1.freebsd.org: domain of vas@sibptus.ru designates 2001:19f0:5001:21dc::10 as permitted sender) smtp.mailfrom=vas@sibptus.ru X-Spamd-Result: default: False [-8.44 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[sibptus.ru:s=20181118]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-3.34)[ip: (-9.86), ipnet: 2001:19f0:5000::/38(-4.93), asn: 20473(-1.86), country: US(-0.05)]; DKIM_TRACE(0.00)[sibptus.ru:+]; DMARC_POLICY_ALLOW(-0.50)[sibptus.ru,none]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:20473, ipnet:2001:19f0:5000::/38, country:US]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.29 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: Mon, 02 Dec 2019 02:56:45 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Dear Colleagues, I was asking this question on the freebsd-net mailing list, but I think it would be better to re-ask it here. There is something I cannot understand about pf's notion of state.=20 Consider this very simple example with two interfaces: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # DMZ 172.16.1.0/24 pass in on $dmz #block in on $dmz from any to 192.168.0.0/16 # Inside 192.168.10.0/24 pass in on $inside =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D While the "block ..." line is commented out, I can "telnet 172.16.1.10 80" = =66rom 192.168.10.3. But when I uncomment the "block ..." line and restart pf, I cannot do that any more. Why is that? My idea was that the "pass in on $inside" creates state so that return traffic from 172.16.1.10:80 to 192.168.10.3:xxxxx should be permitted, but this is not happening so I must be wrong in my understaning how state works. --=20 Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJd5H1qAAoJEA2k8lmbXsY0aJAH/2d5IUdk4bnzj/I/K2+EcgqW Q2kgTKih2LThhyGFG/AAw8YrdXJdobCyyzDpOr9gGOS6qUjx/6Ku7zDFW2HXoD57 zx+gl5o4ztUrvqvzsq/BQkZWQs1fvfAVzmEhPCq2LSP9QWkHucMfOXF/I2RaXKgI CbJuGgZX2WEmMJPNoa7zO+SCfuAUhLXnRwwdypv8cQoAVyX0TmpNXrWydk9wsCkA JDe2g7nTCB8YQR4oh0VExhdhLXuq9LzGcOhbAAAUIm0RJDODE5/is/a4/oHkx4hp ifEtf+hXveeJSrdAYTuVIW1hzPUW7f3WSZLjewPdGjwVBiL/XCF0IiswhbVKmfA= =B905 -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l--