exec.start = "/bin/sh /etc/rc";exec.stop = "/bin/sh /etc/rc.shutdown";exec.clean;mount.devfs;host.hostname = $name;path = "/tank/jails/$name";exec.consolelog = "/var/log/jail_${name}_console.log";vnet;vnet.interface = $vif;exec.start += "ifconfig $vif $addr";exec.start += "route add default $gw";# workaround# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238326exec.prestop += "ifconfig $vif -vnet $name";fserv { $vif = "epair101a"; $addr = "10.0.16.16/24"; $gw = "10.0.16.4"; }mserv { $vif = "epair102a"; $addr = "10.0.16.17/24"; $gw = "10.0.16.4"; }
root@a-fw:~ # zpool create -m /tank tank /dev/gpt/tankroot@a-fw:~ # zfs set compression=on tankroot@a-fw:~ # zfs set atime=off tankroot@a-fw:~ # zfs create tank/jailsroot@a-fw:~ # zfs create tank/jails/baseroot@a-fw:~ # zfs create tank/jails/base/13.0
root@a-fw:~ # mkdir /tank/tmproot@a-fw:~ # cd /tank/tmproot@a-fw:/tank/tmp # fetch ftp://ftp.uk.freebsd.org/pub/FreeBSD/releases/amd64/13.0-RELEASE/base.txzroot@a-fw:/tank/tmp # tar -xJpf base.txz -C /tank/jails/base/13.0root@a-fw:/tank/tmp # cp /etc/localtime /tank/jails/base/13.0/etcroot@a-fw:/tank/tmp # vi /tank/jails/base/13.0/etc/rc.confsendmail_enable="NO"sendmail_submit_enable="NO"sendmail_outbound_enable="NO"sendmail_msp_queue_enable="NO"syslogd_flags="-ss"cron_flags="-J 60"
# No output for successful script runs.daily_show_success="NO"weekly_show_success="NO"monthly_show_success="NO"security_show_success="NO"# Output to log files which are rotated by default.daily_output="/var/log/daily.log"daily_status_security_output="/var/log/daily.log"weekly_output="/var/log/weekly.log"weekly_status_security_output="/var/log/weekly.log"monthly_output="/var/log/monthly.log"monthly_status_security_output="/var/log/monthly.log"# No need for those without sendmaildaily_clean_hoststat_enable="NO"daily_status_mail_rejects_enable="NO"daily_status_mailq_enable="NO"daily_queuerun_enable="NO"# Host does thosedaily_status_disks_enable="NO"daily_status_zfs_zpool_list_enable="NO"daily_status_network_enable="NO"daily_status_uptime_enable="NO"daily_ntpd_leapfile_enable="NO"weekly_locate_enable="NO"weekly_whatis_enable="NO"security_status_chksetuid_enable="NO"security_status_neggrpperm_enable="NO"security_status_chkuid0_enable="NO"security_status_ipfwdenied_enable="NO"security_status_ipfdenied_enable="NO"security_status_ipfwlimit_enable="NO"security_status_ipf6denied_enable="NO"security_status_tcpwrap_enable="NO"
<root@fserv>:/# freebsd-update --currently-running 13.0-RELEASE fetchLooking up update.FreeBSD.org mirrors... none found.Fetching metadata signature for 13.0-RELEASE from update.FreeBSD.org... done.Fetching metadata index... done.Inspecting system... done.Preparing to download files... done.No updates needed to update system to 13.0-RELEASE-p7.
exec.start = "/bin/sh /etc/rc";exec.stop = "/bin/sh /etc/rc.shutdown";exec.clean;mount.devfs;exec.prepare += "service devfs start";host.hostname = "${name}.localdomain";path = "/jails/roots/$name";exec.prepare += "mount -t nullfs -o ro /jails/base /jails/roots/$name";exec.prepare += "mount -t nullfs /jails/$name /jails/roots/$name/rw";exec.release += "umount /jails/roots/$name/rw";exec.release += "sleep 5 && umount /jails/roots/$name";vnet;vnet.interface = "${if}b";exec.prepare += "ifconfig ${if} create";exec.prepare += "ifconfig bridge0 addm ${if}a";exec.prepare += "ifconfig ${if}a inet ${haddr}/24";exec.prepare += "ifconfig ${if}a inet6 2001:db8:1234:5679::${haddr}";exec.start += "ifconfig ${if}b inet ${addr}/24";exec.start += "ifconfig ${if}b inet6 accept_rtadv";exec.start += "ifconfig ${if}b inet6 2001:db8:1234:5679::${addr}";exec.start += "route add default 10.0.9.1";exec.prestop += "ifconfig ${if}b -vnet $name";exec.release += "ifconfig ${if}a destroy";alcatraz { $if = "epair101"; $haddr = "10.0.9.10"; $addr = "10.0.9.11";}
<bridges> <bridged> <linklocal>1</linklocal> <descr>JailBridge</descr> <maxaddr/> <timeout/> <bridgeif>bridge0</bridgeif> <maxage/> <fwdelay/> <hellotime/> <priority/> <proto>rstp</proto> <holdcnt/> <members>invalid</members> <ifpriority/> <ifpathcost/> </bridged> </bridges>
NAME USED AVAIL REFER MOUNTPOINTzroot 2.25G 11.3G 96K /zrootzroot/ROOT 904M 11.3G 96K nonezroot/ROOT/default 903M 11.3G 903M /zroot/jails 1.35G 11.3G 132K /jailszroot/jails/base 464M 11.3G 464M /jails/basezroot/jails/skel 4.41M 11.3G 4.33M /jails/skelzroot/jails/alcatraz 910M 11.3G 876M /jails/alcatrazzroot/tmp 728K 11.3G 728K /tmpzroot/usr 384K 11.3G 96K /usrzroot/usr/home 96K 11.3G 96K /usr/homezroot/usr/ports 96K 11.3G 96K /usr/portszroot/usr/src 96K 11.3G 96K /usr/srczroot/var 5.95M 11.3G 96K /varzroot/var/audit 96K 11.3G 96K /var/auditzroot/var/crash 96K 11.3G 96K /var/crashzroot/var/log 5.45M 11.3G 5.45M /var/logzroot/var/mail 120K 11.3G 120K /var/mailzroot/var/tmp 96K 11.3G 96K /var/tmp
root@OPNsense:~ # cat /etc/rc.conf.d/jailjail_enable="YES"jail_list="unifi-controller-13"