Start/stop DHCP-server via shell



  • Hello,

    I am unable to manually start/stop the DHCP-server via shell command.
    Could somebody please point me into the right direction?

    Many thanks in advance!



  • ok ok - your neglect tells me to be more elaborate. :-)

    There really is some sense behind that question.

    At first I simply wanted to start and stop the DHCP-Server via script, but as I have added another NIC to my pfsense it would be way better if I could change the configuration of the dhcpd to stop listening on one interface. That way, I can keep using DHCP on one interface and turn it off on the other.

    The following basic steps are what I have in mind for the script:
    1.DHCP-config A is loaded, DHCP is running.
    2. Script stops DHCP-server, checks for configuration.
    3. Script detects config A, changes to config B
    4. Script restarts DHCP-server.
    The script would then run as a cronjob.

    I am not sure if this can be done - any help really is appreciated.
    The thing is, that I have been unable to find out how pfsense starts and stops the DHCP-Server although I have tried and researched quite a bit and even asked some friends that are way more unix-skilled than I am.

    Many thanks in advance.



  • this is wat pfsense use to start the dhcpd server:
    /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /var/dhcpd/etc/dhcpd.conf vr0



  • That sounds very useful indeed. I appreciate your quick response. Thank you!


Locked