From owner-freebsd-net@freebsd.org Tue Jan 23 17:39:38 2018 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE247EB9ECE for ; Tue, 23 Jan 2018 17:39:38 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward106p.mail.yandex.net (forward106p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6188429A0; Tue, 23 Jan 2018 17:39:38 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward106p.mail.yandex.net (Yandex) with ESMTP id BF9332D834EF; Tue, 23 Jan 2018 20:39:34 +0300 (MSK) Received: from smtp1p.mail.yandex.net (smtp1p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:6]) by mxback2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id XxuSWIbrXt-dYQGTGFx; Tue, 23 Jan 2018 20:39:34 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1516729174; bh=yhqjGoRH2tsZ7I7bPUmkhXWOkWoc+PEri5GJO/OC2e4=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=IQCM2hOcMScSCwui8pGFZdyLnTDv8uG5mC827VieQH1t0ajUrB7p/qKP1WNTKnKJN pcbyN62LrLARg9TGNtE8KumsmxunyArQvRFJB39cCXxPWi334yoNBRMHp6/w+kZ0Cw d2E8h0RPsf4SgarHb1Y5div1bf9qWvXY2t4igCZs= Received: by smtp1p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id jL8nRqjUSC-dXD8Z7PZ; Tue, 23 Jan 2018 20:39:34 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1516729174; bh=yhqjGoRH2tsZ7I7bPUmkhXWOkWoc+PEri5GJO/OC2e4=; h=Subject:To:Cc:References:From:Message-ID:Date:In-Reply-To; b=IQCM2hOcMScSCwui8pGFZdyLnTDv8uG5mC827VieQH1t0ajUrB7p/qKP1WNTKnKJN pcbyN62LrLARg9TGNtE8KumsmxunyArQvRFJB39cCXxPWi334yoNBRMHp6/w+kZ0Cw d2E8h0RPsf4SgarHb1Y5div1bf9qWvXY2t4igCZs= Authentication-Results: smtp1p.mail.yandex.net; dkim=pass header.i=@yandex.ru Subject: Re: pf: redirect a packet's port but not its address? To: Alan Somers Cc: FreeBSD Net , Kristof Provost References: From: "Andrey V. Elsukov" Openpgp: id=E6591E1B41DA1516F0C9BC0001C5EA0410C8A17A Message-ID: <759792be-189f-bdaf-04c9-b01d26fa9e00@yandex.ru> Date: Tue, 23 Jan 2018 20:39:14 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EUnG8SM6FWjFLianwnxIh9seDmuPZouaX" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2018 17:39:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EUnG8SM6FWjFLianwnxIh9seDmuPZouaX Content-Type: multipart/mixed; boundary="xHGt9vztKETuFlHnR5aksi6wgQMhFXgBZ"; protected-headers="v1" From: "Andrey V. Elsukov" To: Alan Somers Cc: FreeBSD Net , Kristof Provost Message-ID: <759792be-189f-bdaf-04c9-b01d26fa9e00@yandex.ru> Subject: Re: pf: redirect a packet's port but not its address? References: In-Reply-To: --xHGt9vztKETuFlHnR5aksi6wgQMhFXgBZ Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 23.01.2018 19:17, Alan Somers wrote: >>> Unfortunately, pf currently lacks this capability. But it looks like= it >>> could be added without breaking existing pf.conf syntax. Would this = be a >>> good idea? >>> >>> I don't use ipfw, but from reading the man page I believe that it has= the >>> same problem. >> >> I think ipfw should work with such configuration using "fwd" action, >> since TCP/UDP has special handling for this. >=20 >=20 > The man page says that the fwd directive always takes an IP address. W= hat > I need is a way to forward the port without changing the IP address. I= s > that possible in ipfw? "fwd" rule does not changing nor IP address, nor port. It uses some magic with PCB lookup in the TCP/UDP code. Just tried this: # ipfw add fwd ::1,5678 tcp from any to any 4000 # nc -6 -l ::1 5678 And from another host tried: # telnet -6 fc00::1 4000 And this works. --=20 WBR, Andrey V. Elsukov --xHGt9vztKETuFlHnR5aksi6wgQMhFXgBZ-- --EUnG8SM6FWjFLianwnxIh9seDmuPZouaX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEE5lkeG0HaFRbwybwAAcXqBBDIoXoFAlpnc0MACgkQAcXqBBDI oXp0wwgAkC77OtyQBGdnsCV85UN8CUqbRQPn7MhReYP04X909l5nFERlsmI8muSB XV9Y527OU1A6cGvkuGs3lFl2rkKY9Rzo76inygQC5YjSrFl1jfktdwr8kArFQtcs ycRvlaD1SokiPb61V83YuxtO6w9bgywb0hTFMpRvfD04reJI5ktJVwMpFUkX2uzp aC2s+787YH6w28BBVDexH+3Y/SylReSNCUXSLCQTBXL2hJO3wPvlQph+IElbD3dY w9m++Q7iqot2nG/ukgiDFwsFoyJf1TX6BDLP6D7jeDPUVyw0cv3URWO7CREA+VEa 8W01284t2DmEACnKnkimaac9q5+AsA== =+2Ij -----END PGP SIGNATURE----- --EUnG8SM6FWjFLianwnxIh9seDmuPZouaX--