4Feb/15Off
ezjail / jail setup on freebsd 9.3
# cd /usr/ports/sysutils/ezjail
# make install clean
create a base jail
# ezjail-admin install -sp
update the basejail with freebsd-update
# ezjail-admin update -u
update the base jail's ports tree
# ezjail-admin update -P
rc.conf entry ensures our jail will be started at boot and gets the IP it needs.
# ifconfig em0 alias 192.168.1.13 netmask 0xffffff00 broadcast 192.168.1.255
# echo 'ifconfig_em0_alias0="inet 192.168.1.13 netmask 0xffffff00 broadcast 192.168.1.255"' >> /etc/rc.conf
# echo 'ezjail_enable="YES"' >> /etc/rc.conf
Create the jail
# ezjail-admin create myjail.com 192.168.1.13
# cp /etc/resolv.conf /usr/jails/myjail.com/etc/
# service ezjail start
to see running jail
# jls
to get console access to the jail
# ezjail-admin console myjail.com
to stop a jail
# ezjail-admin stop myjail.com
to archive for you to copy a jail
# ezjail-admin archive myjail.com
The archived file should appear in /usr/jails/ezjail_archives. you can then duplicate it as many times as you want. If you install ports, don't bother copying the jail to another machine, there will be missing libraries...
# ezjail-admin create -a /usr/jails/ezjail_archives/myjail.com.tar.gz myjail.com 192.168.1.13
# ezjail-admin start myjail.com