Skip to content

Instantly share code, notes, and snippets.

@antranigv
Last active May 3, 2020 08:51
Show Gist options
  • Save antranigv/a3fc611711b05cd4499d63b368f6bfa1 to your computer and use it in GitHub Desktop.
Save antranigv/a3fc611711b05cd4499d63b368f6bfa1 to your computer and use it in GitHub Desktop.
# cat /etc/jail.conf
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.clean;
allow.raw_sockets;
allow.mount.tmpfs;
mount.devfs;
base {
$id = "10";
$ipaddr = "172.16.150.${id}";
$mask = "255.255.255.0";
$gw = "172.16.150.1";
vnet;
vnet.interface = "epair${id}b";
exec.prestart = "ifconfig epair${id} create up";
exec.prestart += "ifconfig epair${id}a up descr vnet-${name}";
exec.prestart += "ifconfig bridge150 addm epair${id}a up";
exec.start = "/sbin/ifconfig lo0 127.0.0.1 up";
exec.start += "/sbin/ifconfig epair${id}b ${ipaddr} netmask ${mask} up";
exec.start += "/sbin/route add default ${gw}";
exec.start += "/bin/sh /etc/rc";
exec.poststop += "ifconfig epair${id}a destroy";
host.hostname = "${name}.loc";
path = "/usr/local/jailz/${name}";
persist;
}
git0 {
$id = "11";
$ipaddr = "172.16.150.${id}";
$mask = "255.255.255.0";
$gw = "172.16.150.1";
vnet;
vnet.interface = "epair${id}b";
exec.prestart = "ifconfig epair${id} create up";
exec.prestart += "ifconfig epair${id}a up descr vnet-${name}";
exec.prestart += "ifconfig bridge150 addm epair${id}a up";
exec.start = "/sbin/ifconfig lo0 127.0.0.1 up";
exec.start += "/sbin/ifconfig epair${id}b ${ipaddr} netmask ${mask} up";
exec.start += "/sbin/route add default ${gw}";
exec.start += "/bin/sh /etc/rc";
exec.poststop += "ifconfig epair${id}a destroy";
host.hostname = "${name}.loc";
path = "/usr/local/jailz/${name}";
persist;
}
cloned_interfaces="bridge150"
ifconfig_bridge150="inet 192.168.150.1 netmask 255.255.255.0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment