BSDStore
management and repository for FreeBSD jails

Jail config


Attention! I apologize, but it is automatic machine translation of the text. You can improve it if will send to me more correct version of the text or fix html pages via GITHUB repository.

Commands:

% cbsd jconfig jname=jail1
Descriptions: configuration parameters jail

Each cell has its own rc.conf file in $workdir/jails-rcconf/, own the fstab file for a list of mounted file systems in the directory$workdir/jails-fstab/ and its own directory to store the statistics, descriptions of jails, configuration wizards and other supporting files in a directory $workdir/jails-system/

In the TUI-dialog can be brought, not all possible configuration options jails, in which case they can be corrected in the corresponding files via any text editor when jail is stopped

Jails IP address

IP addresses that are bound to the jail sets in $workdir/jails-rcconf/rc.conf_name file in the parameter ip4_addr. As an IP may serve as IPv4, and the IPv6 address. When starting and stopping jail, working with IP may take place in two modes - automatic on-the-fly creation of IP addresses for the jail at the time of launch + automatic removal from the interface IP when stopping or the use of previously initialized IP addresses.

When for jails assigned to more than one address, they should be listed separated by commas without spaces. IP can include network prefix specified through IP/prefix. By default, aliases created with the prefix /32, that may not be appropriate if the jail uses a separate subnet from the network server - in this case, the correct /prefix is needed.

The parameter that controls this behavior stored in $workdir/jails-rcconf/rc.conf_name file and called interface. If it is not in rc.conf-file or the value is 0, jstart and jstop will not be called ifconfig alias and ifconfig -alias, respectively. If its value is 1, before jail start, this command will be executed:


ifconfig alias interface ips,
and when jail stop:

ifconfig inteface ips -alias
Be careful with this option, if you have only one IP for server that is used and this IP is assigned to the same jail: when stopping jail, ip address of the server will be removed automatically that will make the server unavailable. In this case, you need to use in jail rc.conf: interface=0 or just remove "interface" parameters from jail rc.conf. An example of a piece of configuration to create three IP addresses at the start of the jail:

..
interface=1
ip4_addr="176.9.147.18/29,2a01:4f8:160:3002::1/64,192.168.0.2/24"
..

Mounting File Systems in jail

Each jail has own fstab file, which lists the file systems that are mounted in a jail at startup. This file is located in the file $workdir/jails-fstab/fstab.name and coincides with the syntax of the file system format /etc/fstab with the exception that, as the mount point indicated path relative to the jail root, not the master system. For example, if you want to jail1, which is located at
/usr/jails/jails/jail1
on the master host, mount tmpfs for /tmp jail dir (those actually in /usr/jails/jails/jail1/tmp from master filesystem), then the entry in the $workdir/jails-fstab/fstab.jail1 should look like this:

..
tmpfs /tmp tmpfs rw 0 0
..

//to be continued