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

    Script to Enable/Disable Firewall Rule

    Scheduled Pinned Locked Moved NAT
    2 Posts 2 Posters 1.8k 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.
    • D
      defiantmofo
      last edited by

      Is there a way an admin could run a script from the local network to enable/disable a firewall rule?  I wouldn't need to do this remotely, only at home on the same network.  I've searched around a bit, but couldn't find any solid info.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • R
        rjcrowder
        last edited by

        @defiantmofo:

        Is there a way an admin could run a script from the local network to enable/disable a firewall rule?  I wouldn't need to do this remotely, only at home on the same network.  I've searched around a bit, but couldn't find any solid info.

        Thanks!

        Not sure about disabling a rule… but here is what I have implemented... Via a web page I update the file pointed to by a URL alias (see Aliases->URLs tab, then select URL Table when creating the alias). The web page then calls some PHP code to tell pfSense to update the URL table. In order to implement this approach you'd have to run a web server (see vHosts package).

        Why am I doing this? I've got a list of addresses that are used by a rule. The web page updates the list of addresses - which changes the function of the rule.

        I know this doesn't do exactly what you are asking. However, with a little digging and creativity, I'm sure you could find the code that disables a rule and call it from a web page.

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