Pour éditer le wiki, il faut demander un compte à un Lapin !
Difference between revisions of "FreeNAS dans un jail"
From Le L∞p's Wiki
m (wikify, +cat) |
(Backports des modifs faites sur la jail du shakirail) |
||
Line 10: | Line 10: | ||
Ne pas oublier de changer les noms et les adresses IP, et toute autre valeur de <tt>rc.conf(5)</tt> nécessaire. | Ne pas oublier de changer les noms et les adresses IP, et toute autre valeur de <tt>rc.conf(5)</tt> nécessaire. | ||
+ | |||
+ | JAIL_ROOTPATH="/mnt/mainstore/jail" | ||
+ | JAIL_NAME="ports" | ||
mount -o rw / | mount -o rw / | ||
Line 19: | Line 22: | ||
ifconfig_epair0b="up" | ifconfig_epair0b="up" | ||
− | jail_ports_rootdir=" | + | jail_ports_rootdir="$JAIL_ROOTPATH" |
− | jail_ports_hostname=" | + | jail_ports_hostname="$JAIL_NAME" |
− | jail_ports_name=" | + | jail_ports_name="$JAIL_NAME" |
jail_ports_devfs_enable="YES" | jail_ports_devfs_enable="YES" | ||
jail_ports_devfs_ruleset="devfsrules_jail" | jail_ports_devfs_ruleset="devfsrules_jail" | ||
Line 28: | Line 31: | ||
jail_ports_vnet_enable="YES" | jail_ports_vnet_enable="YES" | ||
jail_ports_flags="-l -U root -c persist" | jail_ports_flags="-l -U root -c persist" | ||
− | jail_ports_exec_start="/bin/sh /dev/ | + | jail_ports_exec_start="/bin/sh /dev/null" |
jail_ports_exec_earlypoststart0="ifconfig epair0b vnet ports" | jail_ports_exec_earlypoststart0="ifconfig epair0b vnet ports" | ||
− | jail_ports_exec_afterstart0=" | + | jail_ports_exec_afterstart0="/bin/sh /etc/rc.d/netif restart" |
− | jail_ports_exec_afterstart1=" | + | jail_ports_exec_afterstart1="/bin/sh /etc/rc.d/routing restart" |
+ | jail_ports_exec_afterstart2="/bin/sh /etc/rc" | ||
jail_list="ports" | jail_list="ports" | ||
Line 46: | Line 50: | ||
network_interfaces="lo0 epair0b" | network_interfaces="lo0 epair0b" | ||
ifconfig_epair0b="inet 10.0.0.2 netmask 255.255.255.0" | ifconfig_epair0b="inet 10.0.0.2 netmask 255.255.255.0" | ||
+ | defaultrouter="10.0.0.1" | ||
+ | static_routes="" | ||
+ | |||
syslogd_enable="NO" | syslogd_enable="NO" | ||
inetd_enable="NO" | inetd_enable="NO" | ||
Line 52: | Line 59: | ||
sshd_enable="NO" | sshd_enable="NO" | ||
sshd_flags="" | sshd_flags="" | ||
− | + | ||
− | + | ||
EOF | EOF | ||
[[Category:Projets]] | [[Category:Projets]] | ||
[[Category:Documentation]] | [[Category:Documentation]] |
Revision as of 10:42, 16 December 2012
FreeNAS dans un jail.
Mise en place d'une jail
Bootstrap du système
Sans rentrer dans les détails, il faut d'abord installer le PBI plugin. Ce plugin va créer une jail à l'intérieur de laquelle l'ensemble des fonctions de FreeBSD sont accessibles ; à partir de là, il suffit d'exécuter sysinstall pour installer l'arborescence des sources et l'arborescence des ports, puis de suivre les instructions de la doc FreeBSD sur les jails. Si le fetch de sysinstall échoue, vérifier que le nom de release dans les options est correct.
Configuration de la jail finale
Ne pas oublier de changer les noms et les adresses IP, et toute autre valeur de rc.conf(5) nécessaire.
JAIL_ROOTPATH="/mnt/mainstore/jail" JAIL_NAME="ports"
mount -o rw / cat << EOF >> /conf/base/etc/rc.conf cloned_interfaces="bridge0 epair0" ifconfig_bridge0="addm epair0a addm em0 up" ifconfig_epair0a="up" ifconfig_epair0b="up" jail_ports_rootdir="$JAIL_ROOTPATH" jail_ports_hostname="$JAIL_NAME" jail_ports_name="$JAIL_NAME" jail_ports_devfs_enable="YES" jail_ports_devfs_ruleset="devfsrules_jail" jail_ports_procfs_enable="YES" jail_ports_mount_enable="NO" jail_ports_vnet_enable="YES" jail_ports_flags="-l -U root -c persist" jail_ports_exec_start="/bin/sh /dev/null" jail_ports_exec_earlypoststart0="ifconfig epair0b vnet ports" jail_ports_exec_afterstart0="/bin/sh /etc/rc.d/netif restart" jail_ports_exec_afterstart1="/bin/sh /etc/rc.d/routing restart" jail_ports_exec_afterstart2="/bin/sh /etc/rc" jail_list="ports" jail_v2_enable="YES" jail_enable="YES" EOF mount -o ro / cat << EOF > /mnt/mainstore/jail/etc/rc.conf devd_enable="NO" root_rw_mount="NO" hostname="ports" network_interfaces="lo0 epair0b" ifconfig_epair0b="inet 10.0.0.2 netmask 255.255.255.0" defaultrouter="10.0.0.1" static_routes=""
syslogd_enable="NO" inetd_enable="NO" inetd_flags="-wW -C 60" sshd_enable="NO" sshd_flags=""
EOF