4

I want to know how i can completely configure and add add tables to pfsense via ssh. my goal is to have a web installer that configured multiple system and based on the output it will configure the pfsense firewall.

via the ssh, configure wan, lan automatically enable port 80, 22, etc. based on a conf.txt configuration file.

Thanks

Royce
  • 43
  • 1
  • 1
  • 4

3 Answers3

6

Perhaps its easier when you have a look at ansible and playbooks. There are some playbooks for pfsense and i think you find some more. There you can make templates and configure your firewall over ssh with ansible.

https://github.com/amatas/ansible-pfsense
http://docs.ansible.com/playbooks.html

René Höhle
  • 1,438
  • 3
  • 17
  • 26
0

The pfSense php shell might help you out. Docs at https://doc.pfsense.org/index.php/Using_the_PHP_pfSense_Shell

It appears to allow you to edit and view the config from the ssh shell.

0

The AutoConfigBackup module may suit your use case.

It stores the complete configuration of pfSense in a single XML file.

You could grab, modify and push this file to as many pfSense instances as you want.

<?xml version="1.0"?>
<pfsense>
    <version>11.9</version>
    <lastchange/>
    <theme>pfsense_ng</theme>
    <sysctl>
        <item>
            <descr><![CDATA[Disable the pf ftp proxy handler.]]></descr>
            <tunable>debug.pfftpproxy</tunable>
            <value>default</value>
        </item>
        ...
David McNeill
  • 196
  • 1
  • 10