-
Notifications
You must be signed in to change notification settings - Fork 1
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
Helper tables or macros #6
Comments
As bash is the base for firehol you should be already able to do this, e.g.: standard() { interface "$wan" wan interface "$lan" lan Works just fine. Perhaps we could add an example showing this usage? I notice that adding a parameter will defeat ipv4/ipv6 autodetection so the the following will not work without making the wan interface "standard" command ipv4 explicitly: standard() { interface "$wan" wan interface "$lan" lan |
philwhineray wrote:
Interesting. My approach for that would have been: standard() { interface "spc$wan" wan src 10.0.0.0/8 interface "$wan" wan interface "$lan" lan I suppose I should look into how the ipv4/ipv6 autodetection works. |
Nice; I had not considered that way of doing it. Makes a lot of sense if there will be groups of IPs and services. I currently just have bash variables everywhere. Mostly I just wanted to check that it was possible to pass parameters through to functions and just stumbled on the problem with the autodetection. |
philwhineray wrote:
I have it this way mostly because my firehol config is a derivative of |
Quick question; do we agree that bash functions are sufficient to meet your original requirement or are you thinking of something more? |
The "something more" I'd like to see eventually is being able to avoid I'm uncertain, though if that's just an aesthetic difference, or if :wq |
Okay, I follow now. I guess something should be possible with a bit of
|
It would be very nice to have helper tables to jump to, or, at the very least, macros for inserting recurring sets of rules.
For example, I have five interfaces on one machine which have several rules in common:
Two of the interfaces also have these commonalities:
Additional groupable rules would include internally-facing ICMPv6 vs externally-facing ICMPv6 behaviors.
The text was updated successfully, but these errors were encountered: