From owner-freebsd-jail@FreeBSD.ORG Wed Dec 23 16:10:08 2009 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 21EB910656B6; Wed, 23 Dec 2009 16:10:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id A74D48FC16; Wed, 23 Dec 2009 16:10:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 9490F41C712; Wed, 23 Dec 2009 17:10:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id jYCwPovX3tc6; Wed, 23 Dec 2009 17:10:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 1C8EC41C707; Wed, 23 Dec 2009 17:10:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id D06DC4448EC; Wed, 23 Dec 2009 16:06:50 +0000 (UTC) Date: Wed, 23 Dec 2009 16:06:50 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Mel Flynn In-Reply-To: <200912230637.10093.mel.flynn+fbsd.hackers@mailing.thruhere.net> Message-ID: <20091223160221.R86040@maildrop.int.zabbadoz.net> References: <200912221734.05795.mel.flynn+fbsd.hackers@mailing.thruhere.net> <20091223100943.T86040@maildrop.int.zabbadoz.net> <200912230637.10093.mel.flynn+fbsd.hackers@mailing.thruhere.net> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, freebsd-jail@freebsd.org Subject: Re: Jail on 2 interfaces? 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: Wed, 23 Dec 2009 16:10:08 -0000 On Wed, 23 Dec 2009, Mel Flynn wrote: >> or later; no official FreeBSD version before had supported >> multiple-IPs with a jail. > > 8.0-p3, yes. ok >> What it did was what you were asking for. That's the problem. >> >> 1) either use ifconfig >> 2) or use jail + interfaces >> 3) but do not mix them (especially not overlapping) >> >> So I would suggest to do it like this: >> >> # Base system IPs. >> ifconfig_bge0="inet 192.168.177.60/24" >> ifconfig_em0="inet 192.168.176.60/24" >> >> jail_squid_rootdir="/usr/squid" >> # Either use: >> jail_squid_ip="bge0|192.168.177.62/32,em0|192.168.176.62/32" >> # or: >> jail_squid_ip="bge0|192.168.177.62/32" >> jail_squid_ip_multi0="em0|192.168.176.62/32" >> >> but do not use jail_squid_interface=".." as that will be a global >> default for that jail. > > Is it a global *default* or a global? For example, could I specify: It's a global default; a more specific interface name that comes with an address will override it. So you could do what you drafted below. The entire "ifconfig" feature in rc.d/jail does not really belong there but people started using it after it was introduced so we lost that race. > jail_squid_interface="bge0" > jail_squid_ip="192.168.177.62/32" > jail_squid_ip_multi0="192.168.177.63/32" > jail_squid_ip_multi1="em0|192.168.177.62/32" > > Below is a patch against HEAD to document the $interface|$ip syntax. That wasn't done on purpose; man rc.conf has it, if you lookup jail__ip . /bz -- Bjoern A. Zeeb It will not break if you know what you are doing.