Skip to content
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

Allow ip4/ip6 inherit #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cqexbesd
Copy link
Contributor

Allow users to set ip4 or ip6 to inherit.

This isn't perfect as:

  1. there isn't support for creating these jails in the first place (I create one close to what I want and edit jail.conf by hand)
  2. there is an assumption in Bastille that jail will have an IP, and that pf will be in use so things like stop, while working, also emit Jail IP not found: nnnn from rdr.sh

However it seems to work and might satisfy #369 and #405.

I tried to address the stop IP assumption but I wasn't sure enough about the circumstances when there will be pf rules in place. Perhaps someone who understands all he permutations could produce a table of the different allowed values of ip[46]* and what it means for other networking things (pf rules, vnet interfaces, pairs etc). Then there could be a common set of functions other scripts could call to check if they should be doing any of that stuff.

NB this PR assumes #534 gets pulled first - then this becomes just the one commit.

@arrowd
Copy link
Contributor

arrowd commented Aug 26, 2022

I found it disappointing that it is not possible to just inherit ip4 and ip6 from the host. Looking forward for this PR get merged in.

@bmac2
Copy link
Collaborator

bmac2 commented Oct 19, 2023

534 has been previously merged.

@bmac2
Copy link
Collaborator

bmac2 commented Oct 26, 2023

@cqexbesd I want to merge this but need you to update the code to resolve the conflicts. Sorry it took us this long to get to this.

Either or both ip4 and ip6 can be set to inherit. For example I have used the
following config:

```
  interface = vtnet0;
  ip4 = inherit;
  ip6 = new;
  ip6.addr = 2a01:xxxx:xxxx:xxx::1;
```
@cqexbesd
Copy link
Contributor Author

Rebased

@bmac2
Copy link
Collaborator

bmac2 commented Oct 30, 2023

will review with @cedwards this week and get merged.

@cedwards
Copy link
Contributor

cedwards commented Nov 2, 2023

I like this but let's work on expanding it to full support before we merge anything. In other words, let's add support for creating jails using inherit and make it a first class citizen.

For my own reference, I would appreciate any real examples of using inherit (honestly not a feature I ever personally use, hence the lack of current support). Also, any docs or code on how iocage or others handle inherit-based jails would be nice for me to better understand.

@yaazkal yaazkal added the enhancement New feature or request label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants