Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Feb 2008 19:11:11 -0500
From:      "Glen Barber" <glen.j.barber@gmail.com>
To:        Albert.Shih@obspm.fr
Cc:        freebsd-jail@freebsd.org, freebsd-questions@freebsd.org
Subject:   Re: How to use two interface with jail
Message-ID:  <4ad871310802051611md09347bm3a6b35d44b84e2bd@mail.gmail.com>
In-Reply-To: <20080205162327.GF94606@pcjas.obspm.fr>
References:  <20080205162327.GF94606@pcjas.obspm.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 5, 2008 11:23 AM, Albert Shih <Albert.Shih@obspm.fr> wrote:

> Hi all
>
> I've a server to run FreeBSD 7.0 with jail.
>
> On the server the are two physical interfaces.
>
> This two interfaces are on two different ip subnet.
>
> All jail are on the second interface
>
> 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 =ABdefault router=BB on for the server, anothe=
r for
> all jail.
>
> Regards
>

What I did on a test server was use 1 interface for tx/rx data, and a
'dummy' device, a physical, unattached card, and assigned it an IP in
/etc/rc.conf.

## LAN
ifconfig_ndis0=3D"DHCP"

## Jail LAN
ifconfig_bfe0=3D"inet 10.0.0.2 netmask 255.255.255.255"
ifconfig_bfe0_alias0=3D"inet 10.0.0.3 netmask 255.255.255.255"

I then used pf to route data. I wrote a small tutorial on this, perhaps the
concept will help you:

http://www.dev-urandom.com/freebsd/jail_conf

HTH

--=20
Glen Barber



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4ad871310802051611md09347bm3a6b35d44b84e2bd>