Open eyegog opened 8 months ago
This would be a great enhancement. I'm currently achieving the outcome by modifying the jail.conf by hand and using a patched jib to make it work nicely with multiple bridges.
--- jib 2023-12-21 21:05:09.900919000 +0000
+++ /usr/local/bin/jib 2023-08-25 01:16:54.224528000 +0000
@@ -259,17 +259,10 @@
fi
}
-jib_addm_usage="addm [-b BRIDGE_NAME] NAME [!]iface0 [[!]iface1 ...]"
+jib_addm_usage="addm NAME bridge0 bridge1 ...]"
jib_addm_descr="Creates e0b_NAME [e1b_NAME ...]"
jib_addm()
{
- local OPTIND=1 OPTARG flag bridge=bridge
- while getopts b: flag; do
- case "$flag" in
- b) bridge="${OPTARG:-bridge}" ;;
- *) action_usage addm # NOTREACHED
- esac
- done
shift $(( $OPTIND - 1 ))
local name="$1"
and then the relevant part of the jail.conf:
vnet;
vnet.interface = e0b_port, e1b_port, e2b_port, e3b_port, e4b_port, e5b_port, e6b_port, e7b_port, e8b_port;
exec.prestart += "jib addm port a0 b0 c0 d0 a1 b1 c1 d1 a2";
exec.poststop += "jib destroy port";
I also create the bridge interfaces via rc.conf, some bridged to local vlans.
ifconfig_genet0="up"
ifconfig_genet0_2="up"
ifconfig_genet0_4="up"
ifconfig_genet0_6="up"
ifconfig_genet0_8="up"
vlans_genet0="2 4 6 8"
cloned_interfaces="bridge0 bridge1 bridge2 bridge3 bridge4 bridge5 bridge6 bridge7 bridge8"
ifconfig_bridge0_name="a0"
ifconfig_bridge1_name="b0"
ifconfig_bridge2_name="c0"
ifconfig_bridge3_name="d0"
ifconfig_bridge4_name="a1"
ifconfig_bridge5_name="b1"
ifconfig_bridge6_name="c1"
ifconfig_bridge7_name="d1"
ifconfig_bridge8_name="a2"
ifconfig_a0="inet 10.15.0.1/24"
ifconfig_b0="inet 10.14.0.129/25"
ifconfig_c0="inet 10.14.0.1/25"
ifconfig_d0="inet 10.14.2.1/24"
autobridge_interfaces="a1 b1 c1 d1"
autobridge_a1="genet0.6"
autobridge_b1="genet0.2"
autobridge_c1="genet0.4"
autobridge_d1="genet0.8"
I agree that this would be a good thing to make work. I'm considering moving from iocage to bastille based on the fact that iocage seems to be dead. However I need the ability to apply different vlans to different jails (or interfaces in the same jail) and public ip jails outside the subnet of the host.
Is your feature request related to a problem? Please describe. I do have use cases where I would like to have jails with multiple interfaces attached to different bridges on different VLANs (mgmt, service, etc) for example:
Inside jail:
As far as I am aware, Bastille doesn't support creating VNET jails with this kind of configuration.
Describe the solution you'd like For Bastille to be able to create jails with multiple interfaces, perhaps with something like the following syntax:
Describe alternatives you've considered As of the moment I've written other automation to create VNET jails with multiple interfaces but it would be nice to assimilate this functionality into a single tool.
Additional context Admittedly I am a newbie to the Bastille source code - but I am willing to contribute towards the development of this functionality and mainly I want to know if the dev team would be interested in such a feature :)