Add DHCP MAC Reservation and DNS BIND9 Entry by PHP pfSense Shell



  • Hello everyone,

    I contact you today after looking for the solution to add a DNS entry in BIND9 and an IP reservation in DHCP by scripting with Php Shell.

    It is for an end-of-studies project (complete assembly of an infrastructure for a company) and as the only documentation that we have found is this: https: //doc.pfsense.org/index.php/Using_the_PHP_pfSense_Shell we started writing scripts that modify the configuration files. The problem with this method is that the GUI (based on an XML file) overwrites the configuration files, for example, by a service restart by the pfSense Shell PHP or by a Web console change.

    This is a first problem so we have restarted DHCP by command line (Bash) but there is no new entry in the GUI and if we make a change inside GUI afterwards any modification done by script is lost…

    We also tried to add tags in the XML file but apart from breaking we didn't get a convincing result.

    We know that this is not the right way to do so I would have wanted to know if a good soul could give us direction towards a complete documentation of this PHP shell or give us PHP Shell command lines to do:

    • An entry in a DNS BIND9 area

    • A reservation of IP address by MAC in DHCP LAN

    • Restart these two services for proper consideration

    • All visible in the web interface.

    If we have not search enough, please excuse us but it is really hard to find examples of this type in English or French, while PfSense is a great solution.

    If the complete doc of the PHP shell exists (or something to list possibilities by command line) we would be happy to know where….

    Thank you for reading me, hoping that you can help me and my colleagues.

    Cordially.


Log in to reply