-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENHANCEMENT] Multiple interfaces for VNET jails #656
Comments
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:
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. |
I'd rather see it being a subcommand called "network" or something similar. This would be hard to implement especially for cloning jails and such. The names of the epairs are directly linked to the number of jails, so having even one jail with multiple interfaces would increase the number by 1, and throw errors when creating the next jail. One option is to use the jail name as the interface name. Then the default can stay the default, but any additional ones will be named differently. I'll work on this...
|
I have a working prototype for this feature. Tested with VNET jails as well as bridged VNET jails. As of right now I have not tested cloning or renaming jails. If anyone is interested I can share the file here. It's simply a sub command called network, or net. |
Cloning is now functional as well. |
Renaming cloning creating etc... all functioning. PR incoming... |
#783 Please test. |
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 :)
The text was updated successfully, but these errors were encountered: