Following instructions from the handbook on jail vnet firewall I created a jail with the configuration:
but when running the jail, as follows:
I goth the error
and with
Code:
acme {
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
exec.consolelog = "/var/log/jail_console_${name}.log";
allow.mount;
allow.raw_sockets;
exec.clean;
mount.devfs;
securelevel = 2;
enforce_statfs = 2;
devfs_ruleset = 5;
path = "/jails/${name}";
host.hostname = "${name}";
$ip = "10.0.0.10/24";
$gateway = "192.168.1.1";
$bridge = "bridge0";
$epair = "epair10";
vnet;
vnet.interface = "${epair}b";
exec.prestart = "/sbin/ifconfig ${epair} create up";
exec.prestart += "/sbin/ifconfig ${epair}a up descr jail:${name}";
exec.prestart += "/sbin/ifconfig ${bridge} addm ${epair}a up";
exec.prestart += "/sbin/ifconfig ${epair}a ether something:0a";
exec.prestart += "/sbin/ifconfig ${epair}b ether something:0b";
exec.start += "/sbin/ifconfig ${epair}b ${ip} up";
exec.start += "/sbin/route add default ${gateway}";
exec.poststop = "/sbin/ifconfig ${bridge} deletem ${epair}a";
exec.poststop += "/sbin/ifconfig ${epair}a destroy";
}
Code:
jail -crm -f jail.conf
sysrc -j acme pf_enable=yes
service -j acme pf start
Code:
Enabling pfpfctl: DIOCADDRULE: Operation not permitted
/etc/rc.d/pf: WARNING: Unable to load /etc/pf.conf.
pfctl: DIOCSTART: Operation not permitted
jexec acme ps aux, I can confirm that the firewall is not running.