-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use pf's anchor to load the rules for nat and port forwarding #1
Comments
My understanding is that the main ruleset needs an
Of course this ends up with the same initial problem. If you add an |
Thank you for your comment and your great vm-bhyve project, it helped me a lot. :) |
If it is just for NAT could just using NATD(8) be an option? This would also end up getting you port forwarding a bit easier since it would be just adding the natd config rules for it instead of trying to munge the users firewall to get it to work. |
I think adding anchors in the right places shouldn't be the problem. I'd go with the following to not violate POLA (which IMHO the current situation of just prepending to
Unfortunately, I don't know enough ruby to put this into a PR. |
Now vagrant-bhyve loads pf rules by modifying /etc/pf.conf which is not very a clean way. Sometimes our rules may have a conflict order with those users added before using vagrant-bhyve which will cause a error when restarting PF. We was planing to use pfctl -a to load those rules as an anchor so that we can manage them without touching user's /etc/pf.conf. I used commands like these:
PF restarted correctly and I can see those rules have been loaded into the anchor with
pfctl -a vagrant_<id> -s all
, But none of those rules have an effect. Did I miss any step after load rules as an anchor?The text was updated successfully, but these errors were encountered: