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

    Disable/enable firewall rule from shell (doing ssh) resp. PHP-script?

    Scheduled Pinned Locked Moved Firewalling
    2 Posts 2 Posters 3.2k 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.
    • U
      UweK
      last edited by

      Hi, I've set up a pfSense router succesfully for a students lab.

      But the teachers are interested in enabling/disabling internet access (80/443) for the students manually by clicking on some desktop icons.

      So is there any way to disable/enable a firewall rule from shell (doing ssh) resp. PHP-script?

      I know the rule id and in the the WebGUI the admin can disable/enable rules.

      How is it done from CLI (teachers desktop icon is my problem, I know)?

      Thanks for help.

      UweK

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

        There aren't any existing scripts to do that, but you could write one. It's just PHP.

        Have a look at the "easy rule" code for some examples of manipulating rules like that. Though the code adds rules, not disables, but it does other operations that would be similar.

        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.