[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ezjail] using the same IP address in different jails



> On Feb 9, 2015, at 5:49 PM, Łukasz Wąsikowski <lukasz AT wasikowski DOT net> wrote:
> 
> W dniu 2015-02-09 o 23:02, Dan Langille pisze:
> 
>> I have a jail running with 3 IP addresses.
>> 
>> I want to create a new jail running on two of those IP addresses and one other.  I'm failing.
>> 
>> $ sudo ezjail-admin start nuts.langille.org
>> Configuring jails:.
>> Starting jails: cannot start jail "nuts_langille_org": 
>> .
>> Error: Could not start nuts.langille.org.
>>  You need to start it by hand.
>> 
>> This is what I have in /usr/local/etc/ezjail/nuts_langille_org
>> 
>> jail_nuts_langille_org_ip="10.10.0.168,162.208.116.68,2810:1c1:0:4::4"
>> 
>> This is what I have in the existing jail:
>> 
>> export jail_mailjail_langille_org_ip="10.10.0.68,162.208.116.68,2810:1c1:0:4::4"
>> 
>> Should this work?
> 
> No. You can have multiple jails with the same set of IP addresses. So,
> this will work:
> 
> jail1="ipv4_1,ipv4_2,ipv4_9,ipv6_3"
> jail2="ipv4_1,ipv4_2,ipv4_9,ipv6_3"
> jail3="ipv4_1,ipv4_2,ipv4_9,ipv6_3"
> 
> and this will not:
> 
> jail1="ipv4_1,ipv4_2,ipv4_9,ipv6_3"
> jail2="ipv4_1,ipv4_2,ipv4_9"
> jail2="ipv4_1,ipv4_2,ipv4_9,ipv6_3,ipv6_4"


I failed:

# add two IP addreses
sudo ifconfig em0 alias 10.123.0.1 netmask 255.255.255.255
sudo ifconfig em0 alias 10.123.0.2 netmask 255.255.255.255

# create and start a jail on those IPs
sudo ezjail-admin create -f ansible-slave test1 "10.123.0.1,10.123.0.2"
sudo ezjail-admin start test1

# create a second jail, same IP
sudo ezjail-admin create -f ansible-slave test2 "10.123.0.1,10.123.0.2"

# fail to launch
$ sudo ezjail-admin start test2
Configuring jails:.
Starting jails: cannot start jail "test2": 
.
Error: Could not start test2.
  You need to start it by hand.
— 
Dan Langille
http://langille.org/