Apply IP addresses changes from PHP shell

  • Hi all. I am trying to change the IP addresses of my lan interface and accordingly also the dhcpd range from the PHP shell. I type:

    $config['interfaces']['lan']['ipaddr'] = "";
    $config['dhcpd']['lan']['range']['from'] = "";
    $config['dhcpd']['lan']['range']['to'] = "";

    To actually see the changes to take effect I need to reboot the pfSense. Is there a command in the PHP shell to apply the changes without rebooting?


  • Using interface_bring_down() followed by interface_configure() on the interface will change the IP addresses of the interface, but there's so much mopping up to do afterwards that a reboot is really your only option. pfSense was not designed to be reconfigured from a command line interface.

    If you're curious, look at the if ($_POST['apply']) { } block of /usr/local/www/interfaces.php (line 441 onwards in 2.3).

Log in to reply