-
Notifications
You must be signed in to change notification settings - Fork 146
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] Make automatic rdr rules work on servers with multiple IPv4 addresses #707
Comments
@sveeke can you test the above PR. |
I'll try in January after my vacation! |
I get the following error when I try to add a rdr rule with
I swapped |
The -r is incorrect. It should be -d for "type" And yes, I missed that one function. Let me add it quick. |
Sorry that was a typo from me to GitHub, I used |
And you need the common.sh file from the current GitHub HEAD. That has the "set_target_single" function. |
Yeah with common.sh from current repo that error is gone indeed. But I still get:
The command fills
But effectuating seems to not work. I tried with set -x as well:
Any idea what could be the cause? |
Did you set up your pf rules using 'bastille setup pf'? |
Oops. Looks like your JAIL_IP var is not filling. Let me see... Can you post the full "set -x" output? |
Sure! I changed the IP address and jail name to
|
Ok I know what it is. Give me one sec... |
Try now. |
I had to eat so my response was a bit delayed, but seems that whatever you did worked!
And it seems to work since the proxy inside the jail is reachable from outside as well. One nitpick may be that when Bastille reports back about the rdr rule, it still reports the more general rule as if there isn't a more limited scope:
Instead of something like Thanks a lot for your work on this, it literally makes Bastille usable on servers with multiple IP addresses without having to hack the scripts all the time ;). And also kudos for your quick replies and fixing of the remaining bugs. I would have been helped with the |
There are a lot of issues that were raised about TO, FROM, etc... concerning RDR. so that's why those other switches are also included As for the other message, I'll see about changing it. I kind of just left if generic and to only shown if the rule successfully loads. Thanks for testing... |
Is your feature request related to a problem? Please describe.
My servers/jail hosts have multiple public IPv4 addresses and I can't seem to figure out how this can work properly with Bastille. If there is a better way than my hack, then please let me know 😄.
When Bastille creates the automatic rdr rules for ports that must be forwarded to a jail, the rule applies to all IP addresses, effectively killing all other services that run on the same port number on other IP addresses.
So after doing this:
The created rules will also kill any other service running on ports 80 and 443 on any other IP address on the server.
Describe the solution you'd like
To make it possible to bind Bastille jails to a single outgoing address (or two in the case of using both IPv4 and IPv6) so that Bastille's automatic rdr rules won't apply to all IP addresses on the server.
I hacked this myself by changing line 119 in
rdr.sh
from:To:
So it should be possible to make this configurable.
Describe alternatives you've considered
Additional context
Some relevant parts of my config.
The text was updated successfully, but these errors were encountered: