Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Anchors not processing

    Scheduled Pinned Locked Moved Development
    3 Posts 2 Posters 595 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      gidotop
      last edited by

      I am trying to dynamically add rules to some of the built in anchors to block/allow traffic dynamically when another device ssh's in and runs the appropriate commands, but the pfsense firewall seems to skip right over the built in anchors. Here is what was done so far.

      I created a sample rule of what I need done and added it in the webGUI like normal, then tested it. I then ran a pfctrl -sr and copied that rule so I had the syntax correct. I removed the rule in the webGUI and then use the echo "rule" | pfctrl -a userrules -f - to add the rule to the anchor. I checked to make sure it is there with pfctrl -a userrules -sr and it was added correctly, but when I test the rule it isn't processed by the pfsense at all. Is there so other step to using the anchors besides inserting a rule? According to everything I have read that is all that is required. Thanks

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        Without seeing the exact contents of the rule/anchor and exactly what you tested, there is no way to know what might have happened.

        Anchors shouldn't take anything extra to activate, the internal ones that get actively used, like miniupnpd work without anything special.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • G
          gidotop
          last edited by

          So a good example would be something like this:

          pfctrl -sr currently prints out the rule set and userrules anchor (anchor "userrules/*" all) is empty. I have confirmed with a pfctrl -a userrules -sr which returns nothing. I then added the following:

          echo "pass in quick on em0 inet proto tcp from 192.168.1.7 to any port = 32400 flags S/SA keep state" | pfctl -a userrules -f -

          when I run pfctrl -a userrules -sr after this I get:
          pass in quick on em0 inet proto tcp from 192.168.1.7 to any port = 32400 flags S/SA keep state

          The rule doesn't work though and it doesn't display with a pfctrl -sr either. I can't see what I am specifying wrong, I have tried calling the anchor with and with out the /* in quotes a few times and it places the new rule under the userrules anchor as displayed with pfctl -a userrules -sr each time. I can clear it with pfctl -a userrules -Fr as well. Given this example can you see where I have gone astray? Thank you for your help.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.