From owner-freebsd-jail@FreeBSD.ORG Tue Feb 5 16:37:25 2008 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5EE116A417; Tue, 5 Feb 2008 16:37:25 +0000 (UTC) (envelope-from lists@c0mplx.org) Received: from home.c0mplx.org (unknown [IPv6:2001:14f8:200::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9AC2B13C461; Tue, 5 Feb 2008 16:37:25 +0000 (UTC) (envelope-from lists@c0mplx.org) Received: from pi by home.c0mplx.org with local (Exim 4.66 (FreeBSD)) (envelope-from ) id 1JMQnV-000FJ7-Bd; Tue, 05 Feb 2008 17:37:25 +0100 Date: Tue, 5 Feb 2008 17:37:25 +0100 From: Kurt Jaeger To: Albert Shih Message-ID: <20080205163725.GK1757@home.c0mplx.org> References: <20080205162327.GF94606@pcjas.obspm.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080205162327.GF94606@pcjas.obspm.fr> Cc: freebsd-jail@freebsd.org, freebsd-questions@freebsd.org Subject: Re: How to use two interface with jail X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2008 16:37:26 -0000 Hi! > How can I make > > all traffic from the server/for the server pass through the first > interface > > all traffic from the jail /for the jail pass through the second > interface. > > In fact : How can make two «default router» on for the server, another for > all jail. Assuming you can use ipfw, here's an example: - Interfaces: if1: 192.168.1.1, gateway 192.168.1.254 if2: 192.168.2.1, gateway 192.168.2.254 - system uses 192.168.1.254 as its default gateway. - IP-ranges for jails are in the 192.168.2.0/24 range. - Then add the following ipfw rule: /sbin/ipfw add 1000 fwd 192.168.2.254 ip from 192.168.2.0/24 to any out via if2 Give it a try. -- pi@opsec.eu +49 171 3101372 12 years to go !