Fwconsole enable firewall custom rules

Hi folks,

I’m working on a setup to monitor some remote FreePBX boxes with the Zabbix agent. Pretty standard stuff – agent install, config, and opening the port in the firewalls.

Right now, I’m using the FreePBX GUI to open the port, going into the firewall and adding a custom rule to the IPv4/IPv6 file.

Wondering if anyone knows if we can do this through the command line with fwconsole? Would be awesome for automating this with Ansible.

Thanks!

There’s some documentation on Custom Rules:

Besides the GUI button to enable CRs, the initial setup can be done on the command line as well:

fwconsole firewall fix_custom_rules

Find and update the kvstore entry for this in the asterisk database in MySQL and then do a reload to enable custom rules. Then add and entry for your zabbix server in /etc/firewall-4.rules and fwconsole firewall restart to load the rules.

Dear Eris,

This sounds very promising! I hadn’t considered directly modifying the kvstore entry within MySQL. That’s an interesting approach.