Update FreePBX firewall rules

I’m looking for a way to update the FreePBX fire wall rules using via script, API, or other method?

We have 100+ users who’s IP addresses change frequently. Our goal is for users to submit a Form with their new IP address and have it automatically create the new firewall rule and remove the old rule (for security). We are comfortable writing the scripts and we have access to Asterisk Managers Interface (AMI).

I see that the table “iptables” shows all the allowed IP addresses but I’m concerned that simply modifying that list via Linux command doesn’t make all the needed changes.

So my question is, what is the best way to update the FreePBX firewall rules, using scripts/API or other method, without having to manually update each time using the GUI?

1 Like

Not a direct answer to your question, but we require everyone to us our VPN to connect to our FreePBX instance. The VPN network is added to the FreePBX firewall via GUI–simplifying that side of things. It does add complexity on the user side of things, and another service to run and manage, but once the users are set up on the VPN, they only have to remember to connect to the VPN and then run their SIP client.