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

[ENHANCEMENT] create: Change "interface" to "ip4.addr = if|ip" #788

Open
tschettervictor opened this issue Jan 4, 2025 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@tschettervictor
Copy link
Collaborator

tschettervictor commented Jan 4, 2025

Since I've started working on PR #783, I've noticed a few minor things that could be tweaked.

  1. Classic jails get created in this following format
  interface = bastille0;
  ip4.addr = 10.0.0.1;

This makes it slightly difficult to deal with adding and removing interfaces from the jail.conf file.

I've currently implemented the following structure when creating jails
ip4.addr = bastille0|10.0.0.1

This makes it really easy to add multiple IP/interface pairs like the following example.

  ip4.addr = bastille0|10.0.0.1
  ip4.addr += bastille0|10.0.0.2
  ip4.addr += bastille0|10.0.0.3
  ip4.addr += bridge0|10.0.1.9

I will suggest editing create.sh (which I have done easily in my version) to just create classic jails in that way.

@tschettervictor tschettervictor added the enhancement New feature or request label Jan 4, 2025
@tschettervictor tschettervictor changed the title [ENHANCEMENT] [ENHANCEMENT] create: Change "interface" to "ip4.addr = if|ip" Jan 4, 2025
@bmac2
Copy link
Collaborator

bmac2 commented Jan 4, 2025

I am ok with the change.

@yaazkal your thoughts?

@tschettervictor
Copy link
Collaborator Author

@JRGTH

@Schueni1
Copy link

Schueni1 commented Jan 31, 2025

Oh yes that would be nice.
I am currently defining my network interfaces and ips like this:

interface = lo0;
ip4.addr = lo0|127.0.0.10/8;
ip4.addr += lagg0|192.168.42.10/24;

But having to specify one of the interfaces separately and the rest together with the 'ip4.addr' is a bit weird.

When starting the jail this message is always shown:
no IP address found for lo0|127.0.0.10/8,lagg0|192.168.42.10/24
But it seems to work regardless and the ips are getting assigned to the respective interfaces.

@tschettervictor
Copy link
Collaborator Author

tschettervictor commented Jan 31, 2025

@Schueni1 You can test #830 which implements this feature.

Keep in mind that you will also need #765 to properly load rdr rules if you use those.

@Schueni1
Copy link

Schueni1 commented Feb 5, 2025

Hi,

I applied #830 and #765 to the current master branch. Looks good :)
The IPs are getting assigned and the no IP address found for ... message is not showing anymore.

Tested with the following configurations:

ip4.addr = lagg0|192.168.42.7/24;
ip4.addr += lo0|127.0.0.7/32;
ip4.addr += vps|10.42.69.7/24;

And the previous (backwords compatible) configuration:

interface = lagg0;
ip4.addr = lagg0|192.168.42.7/24;
ip4.addr += lo0|127.0.0.7/32;
ip4.addr += vps|10.42.69.7/24;

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

No branches or pull requests

3 participants