Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jun 2007 09:29:13 +0200
From:      Roger Gujord <roger@gujord.com>
To:        freebsd-jail@freebsd.org
Cc:        beto@octantis.com.au
Subject:   Re: Different Netmasks for jails
Message-ID:  <4684B4C9.90101@gujord.com>
In-Reply-To: <20070628213520.6e561b42@localhost>
References:  <468386A5.9040900@gujord.com> <20070628213520.6e561b42@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
Norberto Meijome wrote:
> On Thu, 28 Jun 2007 12:00:05 +0200
> Roger Gujord <roger@gujord.com> wrote:
>
>   
>> How can I have a netmask like 255.255.255.128 for one jail and a netmask 
>> like 255.255.255.240 for another jail without creating static aliases at 
>> hosts boot-time in /etc/rc.conf ?
>> I would like the /etc/rc.d/jail to create the network aliases according 
>> to the jails respective network mask. I see that /etc/rc.d/jail sets the 
>> netmask to 255.255.255.255 for all network aliases.
>>     
>
> Hi :)
>
> I'm pretty sure this is the same FAQ as seen in questions@ / net@ wrt netmasks
> of aliases. In short, if your aliased interfaces are in the *same* subnet as
> your main IP (eg, the main IP's subnet includes all the aliased subnets), they
> will be /32. 
>   
Thanks for your answer Norberto :-)
If I understand you correctly, you are saying that the same netmask as 
the one for the hosts main IP will apply to all jails and therefore 
there is no need to specify a netmask other than /32 for each jail in 
the same subnet.
But this is not my case. I have two different subnets in the same 
IP-range with different netmasks (of course) and also another IP-range.

-------------------------------------------------------
Subnet ID          Broadcast Address    Subnet Mask
-------------------------------------------------------
192.168.1.0  /25   192.168.1.127        255.255.255.128
192.168.1.48 /28   192.168.1.62         255.255.255.240
192.168.2.96 /27   192.168.2.127        255.255.255.224


I'm trying to configure jails to run in all three subnets on the same host:
mainHost 192.168.1.1/25
jailHostA 192.168.1.2/25
jailHostB 192.168.1.54/28
jailHostC 192.168.2.100/27

I guess the jailHostA is OK since it's running in the same subnet as the 
mainHost. But how do I configure jailHostB and C without creating a 
static aliased interface (in /etc/rc.conf) when all jails are started up 
with netmask /32 (from /etc/rc.d/jail) ?

Thanks! :-)

--Roger




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