Starting on p. 165, to create a jail with multiple interfaces, you need to do:
Step 2: /etc/jail.conf:
Step 3:
- create a cloned interface (lo1),
- specify multiple interfaces for the jail in a comma-separated list,
- call the jib script with the bridge names,
- be happy.
Code:
ifconfig_em0_name="lab"
cloned_interfaces="lo1"
Step 2: /etc/jail.conf:
Code:
gw {
vnet;
vnet.interface = e0b_$name, e1b_$name;
exec.prestart += "/usr/local/scripts/jib addm $name lab lo1";
exec.poststop += "/usr/local/scripts/jib destroy $name";
allow.raw_sockets;
}
Step 3:
service jail start gw
which calls the script jib:
Code:
# service jail start gw
Starting jails: cannot start jail "gw":
ifconfig: BRDGADD lo1: Invalid argument
jail: gw: /usr/local/scripts/jib addm gw lab lo1: failed
.
#