From owner-freebsd-net@freebsd.org Mon Jul 17 17:26:40 2017 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 E8F06D9B0FD; Mon, 17 Jul 2017 17:26:40 +0000 (UTC) (envelope-from lists@opsec.eu) Received: from home.opsec.eu (home.opsec.eu [IPv6:2001:14f8:200::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 B191168782; Mon, 17 Jul 2017 17:26:40 +0000 (UTC) (envelope-from lists@opsec.eu) Received: from pi by home.opsec.eu with local (Exim 4.89 (FreeBSD)) (envelope-from ) id 1dX9n9-0002DD-0i; Mon, 17 Jul 2017 19:26:43 +0200 Date: Mon, 17 Jul 2017 19:26:42 +0200 From: Kurt Jaeger To: Grzegorz Junka Cc: freebsd-net@freebsd.org, freebsd-jail@freebsd.org Subject: Re: A web server behind two gateways? Message-ID: <20170717172642.GF39925@home.opsec.eu> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jul 2017 17:26:41 -0000 Hi! > I have a jail running a web server in LAN. There are two routers/WANs > that can connect LAN to the internet. I enabled NAT and port forwarding > to the web server on both routers. [...] > Can I configure either router/host/jail so that the web server sends the > response back to the IP that sent the request packet rather than to the > default gateway? I have a vague idea: If you set a tag (or a keep-state :flowname) using a ipfw rule that matches the incoming gateway MAC and match that tag/check-state flowname and the connection (keep-state) to fwd the answer packet back to that gateway ? -- pi@opsec.eu +49 171 3101372 3 years to go !