1

Is it possible, with a pfsense pc as a router, to write a script on my pc that will send and/or execute settings changing script on the router. Allowing me to change settings with a click on a client pc of the network???

2 Answers2

1

You can connect to pfsense by SSH and manage it by this way. Use expect package on a Linux client PC to connect to the firewall thanks to a script.

Pitou
  • 26
  • 3
0

pfSense does not yet provide such ability. Netgate, the company behind pfSense, is working accordingly to a Blog post on a complete rewrite of the UI:

Future versions of pfSense have a new management model. We’re leveraging YANG, via RESTCONF.

The webGUI will be present either on our cloud service or on-device, both talking to the ‘back-end’ (written in ‘C’) on the device via a RESTCONF interface. This is just as I said back in February 2015.

The entire PHP layer is being eliminated in the “3.0” effort, and we’re simply too small to continue to maintain both the current, organically-grown PHP layer (100K lines of PHP in 200 files) and the new, pure JS GUI (client) architected as a single page web application.

So there is an excellent chance that pfSense 2.5 will use the new webGUI, talking to our RESTCONF back-end.

In the meanwhile, if you think it is worth the effort and the changes you have to do are small and recurring, you can have a look into the configuration "Backup & Restore" functionality. The configuration is a single XML file which you can also get via SCP. It is located in /conf/config.xml. You could write a script that performs your intended changes in the XML file. Automating the deployment of the new config is not trivial, as you have to go via the webinterface.

There is also a fork called opnSense which has a REST API.

Community
  • 1
  • 1
nextloop
  • 61
  • 4