From owner-freebsd-questions@freebsd.org Wed Jun 19 18:43:49 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47D1815C686E for ; Wed, 19 Jun 2019 18:43:49 +0000 (UTC) (envelope-from merlyn@geeks.org) Received: from mail.geeks.org (mail.geeks.org [IPv6:2001:4980:3333:1::1]) (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 C0DD1758A4 for ; Wed, 19 Jun 2019 18:43:48 +0000 (UTC) (envelope-from merlyn@geeks.org) Received: from mail.geeks.org (localhost [127.0.0.1]) by after-clamsmtpd.geeks.org (Postfix) with ESMTP id 27766110219 for ; Wed, 19 Jun 2019 13:43:47 -0500 (CDT) Received: by mail.geeks.org (Postfix, from userid 1003) id 06E3C110209; Wed, 19 Jun 2019 13:43:47 -0500 (CDT) Date: Wed, 19 Jun 2019 13:43:47 -0500 From: Doug McIntyre To: freebsd-questions@freebsd.org Subject: Re: IPFW redirect to another port? Message-ID: <20190619184346.GA34759@geeks.org> References: <20190618165028.83C662015F9118@ary.qy> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190618165028.83C662015F9118@ary.qy> User-Agent: Mutt/1.10.1 (2018-07-13) X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 18:43:49 -0000 On Tue, Jun 18, 2019 at 12:50:27PM -0400, John Levine wrote: > I would like to use ipfw to redirect incoming port 53 requests from a > few IP addresses to a different port, so I can use a custom DNS server > to answer them. I can figure out how to redirect their traffic to, > say, port 5553, but the responses come from 5553 which of course > doesn't work. > > Any suggestions about how to adjust the port numbers going both ways? It's > fine if they screw up other traffic to those IPs. TIA. I would approach this differently. I'd install dns/dnsdist to listen on port 53, and then with backends out to your custom DNS server on port 5553.