Multiple Jails Network Problem.

Status
Not open for further replies.

c163

Cadet
Joined
Oct 23, 2011
Messages
6
Hello,

I installed 2 jails on one Freenas server followed by
http://forums.freenas.org/showthread.php?3279-HOWTO-Install-Serviio-in-a-FreeBSD-Jail-on-FreeNAS-8.0.x&highlight=jails[HOWTO] Install Serviio in a FreeBSD Jail on FreeNAS 8.0.x
and http://forums.freenas.org/showthread.php?2672-HOWTO-Install-JDownloader-in-a-FreeBSD-Jail [HOWTO] Install JDownloader in a FreeBSD Jail
Either of thest 2 jails could run fine separately. But when I put them together, only one jail can run correctly. I thought there could be some problem with the network settings. I only could see 2 IP address after the Freenas reboot. One was the Freenas, One was the Jdownloader jail. I could not communicate with the IP of the serviio.

I also noticed this one

http://forums.freenas.org/showthread.php?3208-question-about-jail.&highlight=jails"question about jail. " "You can add more jails of course. Don't forget to tweak the network config of FreeNAS to have another network alias for jail_${foo}_ip."


Could someone please give some more information about this ? What was the problem? Thanks.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Hi c163,

Thats a good question, I haven't tried running multiple jails at the same time although I know it's supposed to be possible. So, just to confirm, you have a different IP address listed in rc.conf for each jail and separate settings for each Jail?

So, something like this (the paths will be different for you of course):

#Jail Config Settings

jail_enable="YES"
jail_set_hostname_allow="YES"
#
jail_list="jdwnldr"
jail_jdwnldr_hostname="jdjail"
jail_jdwnldr_ip="10.0.10.30"
jail_jdwnldr_interface="em0"
jail_jdwnldr_rootdir="/mnt/cortex/jail/JD_chroot/JD_root"
jail_jdwnldr_devfs_enable="YES"
jail_jdwnldr_mount_enable="YES"
jail_jdwnldr_fstab="/etc/fstab.jdwnldr"
jail_jdwnldr_exec_afterstart="mount_nullfs -o rw /mnt/tank/_New_Downloads /mnt/tank/jail/JD_chroot/JD_root/usr/local/DOWNLOADS"
#
#
jail_list="serviio"
jail_serviio_hostname="serviio"
jail_serviio_ip="10.0.10.40"
jail_serviio_interface="em0"
jail_serviio_rootdir="/mnt/tank/Serviio_jail/Serviio_root"
jail_serviio_devfs_enable="YES"
jail_serviio_mount_enable="YES"
jail_serviio_fstab="/etc/fstab.serviio"
 

c163

Cadet
Joined
Oct 23, 2011
Messages
6
Thanks for your reply. Yes , I confirmed I had a different IP address listed in rc.conf for each jail and separate settings for each Jail.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I can't test with 2 jails right now because one of my jails is i386 and the other amd64. What I would suggest trying is changing the jail_<name>_interface for each jail in rc.conf to something different. I can't find any clear documentation about this yet, only that it's possible and it's also possible for each jail to have multiple IP addresses.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Ok, found the problem, nothing to do with the interface name. The names of the jails must be on one line in the 'jail_list' line in rc.conf. Here is a working example:

#
jail_enable="YES"
jail_set_hostname_allow="YES"
#
jail_list="serviio jdwnldr" (Jail names must be separated by a space)
jail_serviio_hostname="serviio"
jail_serviio_ip="10.0.10.150"
jail_serviio_interface="em0"
jail_serviio_rootdir="/mnt/tank/Serviio_Jail/Serviio_root"
jail_serviio_devfs_enable="YES"
jail_serviio_mount_enable="YES"
jail_serviio_fstab="/etc/fstab.serviio"
#jail_serviio_exec_afterstart="" (will start a command inside jail after booting)
#
#
jail_jdwnldr_hostname="jdjail"
jail_jdwnldr_ip="10.0.10.160"
jail_jdwnldr_interface="em0"
jail_jdwnldr_rootdir="/mnt/tank/JD_chroot/JD_root"
jail_jdwnldr_devfs_enable="YES"
jail_jdwnldr_mount_enable="YES"
jail_jdwnldr_fstab="/etc/fstab.jdwnldr"

EDIT: It's also possible to run both JDownloader and Serviio in the same jail since they both require Java. You would need to copy the lines from both fstab.serviio and fstab.jdwnldr into one fstab.NEW-jail. It would save a few system resources. You can add whatever other programs into either of the jails if you have the right dependencies installed, even run an X-server or full FreeBSD installation.
 
Status
Not open for further replies.
Top