$bridge = "bridge0"; $gateway = "XX.XX.XX.XX"; # PATH/HOSTNAME path = "/jails/${name}/rootfs"; host.hostname = "${name}"; # VNET/VIMAGE vnet; vnet.interface = "B$name"; exec.prestart = "/root/bin/jailCreateEpair.sh $name"; # have to remove the mask part of ip in order to by able to use the ip in firewall rules exec.prestart += "(echo -n '# $note\next_if = \"B$name\"\next_ip = \"' && echo -n '${ip}'|cut -d \"/\" -f 1|tr -d '\n' && echo -n '\"\n')> ${path}/etc/pf_local_definitions.conf"; # I mount a common config file direcotry for shared configs and settings exec.prestart += "mkdir -p ${path}/etc/ovps_shared"; exec.prestart += "mount_nullfs -o ro /etc/ovps_shared ${path}/etc/ovps_shared"; exec.start = "ifconfig B$name ${ip} up"; exec.start += "route add -net XX.XX.XX.XX/29 -interface B$name || true"; exec.start += "route add -net XX.XX.XX.XX/28 -interface B$name || true"; exec.start += "route add -net 192.168.145.0/24 81.31.45.55"; exec.start += "route add default ${gateway}"; exec.start += "/bin/sh /etc/rc"; exec.poststop = "ifconfig bridge0 deletem A$name"; exec.poststop += "ifconfig A$name destroy"; exec.release = "umount -t nullfs ${path}/etc/ovps_shared"; # STARTUP/LOGGING exec.stop = "/bin/sh /etc/rc.shutdown"; exec.consolelog = "/var/log/jail_console_${name}.log"; # PERMISSIONS allow.raw_sockets; exec.clean; mount.devfs; devfs_ruleset = 5; .include "/jails/*/c.conf";