-
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
[BUG] pfctl still invoked on VNET jails #346
Comments
That depends; for example I have a VNET setup which is NATed to my external interface so that I can access the internet or deploy a VPN server inside a jail. So in my case it's a good thing that Bastille behaves this way, however there should be a way to configure this depending on your setup I guess. |
What is the purpose of having VNET jails when you do NAT where you could just use cloned
Maybe for you, but this is an assumption Bastille does w/o knowning this jail uses pf anyhow. It should be configure whether bastille should interact with pf. |
Some applications require a dedicated network stack and do not work with |
@KizzyCode I'd be interested how this looks like configuration-wise. |
Ok, basically:
So thats the point where we need NAT for outgoing traffic and RDR for incoming traffic. Currently I use For a more complete example, take a look at: https://genneko.github.io/playing-with-bsd/networking/freebsd-wireguard-jail/ |
While I see -- after @KizzyCode's explanation -- use cases for this, this should be create time option whether bastiile should take care of this or not. |
Can this finally be solved by provinding a |
I don't use Regards |
Can this finally be addressed? |
This is still open in the latest relese :-( |
Is this still an issue? The start and stop commands will only invoke pfctl if the command itself is found, or the "ip4.addr" is set in jail.conf |
The command is always present:
thus
with
|
Can you try adding "> /dev/null" to the "which -s pfctl" command? |
|
I mean inside the "stop.sh" script. |
Seems to be inconsistent this check:
but does one expect the system to be compiled without pf? The test with |
This check should actually check if NAT is being used before attempting to call pfctl. |
Obviously, it doesn't :-( |
Here is the problem:
but the test does:
obviously |
The logic to determine the IPv4 addressed in start.sh is different to stop.sh. stop.sh needs to be aligned to start.sh and the issue should be gone. |
Fix for start.sh:
Will need to raise a PR for this. |
Does this function as expected? |
Yes, pf is then skipped at start time. |
Great! I'll open a PR. |
For me the ip4.addr can also sometimes be "-" so I'll include that also. |
How so? Buy if so, search for other occurrences as well. |
My bad. That's just when using the raw command. |
fixed with PR just merged |
If I want to use vnet, does it do any harm to have pf running with
in the pf.conf? |
[MANDATORY] Describe the bug [MANDATORY]
I have a vnet jail, no loopback
bastille0
yet I see on stop:I don't have pf enabled and don't need it on the jailhost.
[MANDATORY] Bastille and FreeBSD version (paste
bastille -v && freebsd-version -kru
output)0.8.20210115
12.2-STABLE
12.2-STABLE
12.2-STABLE
[MANDATORY] How did you install bastille? (port/pkg/git)
port
[optional] Steps to reproduce?
Create a vnet jail, start and stop
[optional] Expected behavior
No
pfctl
actions[optional] Additional context
The issue comes from here:
bastille/usr/local/share/bastille/stop.sh
Lines 59 to 60 in af8d766
My understanding ist that pf is only necessary when you don't have external external IP addresses and need to do NAT. This does not apply to VNET jails. I do run VNET only. I don't know whether
bastille rdr ...
can also be run at runtime, but all rdr/pdf/loopback related checks should be skipped for a VNET jail.The text was updated successfully, but these errors were encountered: