-
Notifications
You must be signed in to change notification settings - Fork 143
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
RDR Improvements: Allow TO/FROM+INTERACE+IP STACK #765
base: master
Are you sure you want to change the base?
RDR Improvements: Allow TO/FROM+INTERACE+IP STACK #765
Conversation
This is for the folks who have multiple IP addresses on a single interface.
I've reconstructed much of the rdr.sh to allow users to set TO/FROM and also the interface.
Error checking is also in place, and testers are welcome. |
RDR will now show errors for any rule that failed to create. |
Currently, rules are only persisted if both IP4 and 6 rules can be loaded. This means that if for some reason the IP6 rules can't be loaded, then they won't be entered into rdr.conf. This is because the "load_rule" functions try to load both, and only if they both pass will it persist the rule. @yaazkal Would it be better to split the function, or just revert back to persisting the rule and then loading it? |
I just ran into this trying to create a jail with both IP4 and 6. The jail works, but any rdr rules fail to persist because the interface that they were created on doesn't support IP6, so the IP4 rules load, but not the IP6 ones. Current implementation has great error handling and will not accept false inputs when doing "bastille rdr" so perhaps persisting the rule first is best. |
@yaazkal Looks like there was a bug in the rule that called "inet" instead of "inet6" when creating IPv6 rules. IPv6 is now working as expected also. |
Here is my output.
|
Dual stack can still be a problem when doing -d or -s though. |
New! -t|--type
|
@tschettervictor this one has conflicts. I was going to start testing but need it cleanedup then I will start testing. |
Done. |
I've reconstructed much of the rdr.sh to allow users to set TO/FROM and also the interface.
Old command of
bastille rdr jail tcp 8000 80
still functions as it should and will use the default interface and any to any when creating the rules. Major differences are-i em0
or any specified interface-s 134.234.67.34
-d 192.168.1.45
-t
is also available if you want to specifically load a rule doing ip4/6-t ipv4
or-t ipv6
. The default will use both, or 'dual'Error checking is also in place, and testers are welcome.
I will continue to update this PR with the docs and usage commands if users find this helpful.