Setting up FreeBSD 10.3 Jails

Just some rough working notes on setting up FreeBSD 10.3 jails in 2016. I've done this from a fresh install from a virtual image on the FreeBSD downloads page- so literally from an empty, bare minimum base image.

I noted that older documentation seems to leave out key details, is incompatible with current builds, etc. Thought it would be worth documenting what I did in order to get jails working nicely, in case someone else finds it of use.

Get the base of ezJail set up, as advised by the FreeBSD documentation:
echo 'cloned_interfaces="lo1"' >> /etc/rc.conf  
echo 'ezjail_enable="YES"' >> /etc/rc.conf 
pkg boostrap 
pkg install ezjail
Set up /usr/ports so we have something to base our jails off, and then create the base jail (this will implicitly do a make installworld). This will take fucking ages. Maybe chain the commands together (using ';') and grab a coffee or 7.
svn checkout https://svn.FreeBSD.org/base/stable/10 /usr/src 
cd /usr/src 
make buildworld 
ezjail-admin update -i -p
Now we can restart the box, have ezjail start up for us & be ready to use:
ezjail-admin create dnsjail 'lo1|127.0.1.1'
ezjail-admin start dnsjail
ezjail-admin console dnsjail
And there's your jail :)

Comments

Popular posts from this blog

2020 Hack-A-Sat DEFCON Space Security Challenge CTF Qualifiers 2020 - Part 1

Man-in-the-middling SSL / TLS on Windows

2021 Hack-A-Sat DEFCON Space Security Challenge CTF Qualifiers Writeup - Linky