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

    Add and modify firewall rules remotely - API?

    Scheduled Pinned Locked Moved General pfSense Questions
    3 Posts 3 Posters 1.7k 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.
    • H
      herr.schnegg
      last edited by

      Hi

      What would be the best way to automatically create/modify pfSense firewall rules from a remote system? I need this for an ongoing project, and I haven't found a solution yet. Is there a way to do this? Could I do this with the PHP shell on pfSense or is there an API?

      I could also spend some hours working on an API.

      1 Reply Last reply Reply Quote 0
      • GruensFroeschliG
        GruensFroeschli
        last edited by

        You could read the config.xml, (in /conf) edit it, restore back and reload the rules.

        We do what we must, because we can.

        Asking questions the smart way: http://www.catb.org/esr/faqs/smart-questions.html

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

          If you just want to add a rule, check out easyrule.php in 2.0 or in the Dashboard package in 1.2.3. You could probably call that remotely with the right params and do what you need.

          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
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.