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

  • 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.


  • Rebel Alliance Developer Netgate

    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.