Where to put in a dhcpd.conf modification script?

Home Page Forums Network Management ZeroShell Where to put in a dhcpd.conf modification script?

This topic contains 7 replies, has 0 voices, and was last updated by  lidocaineus 8 years, 11 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #42070

    lidocaineus
    Member

    I’d like to add some custom dhcpd.conf options, but how do I get the dhcpd to reread the changes?

    I can copy over a custom file to /var/register/system/dhcp/dhcpd.conf with a post-boot script but by then, the dhcp server has been started. If I disable/re-enable the dhcp server it overwrites the changes.

    #49179

    ppalias
    Member

    Would it work if you copy the custom file in pre-boot instead of post-boot?

    #49180

    lidocaineus
    Member

    Unfortunately no, because it does the same thing – any file is just overwritten by whatever is generated when you hit “enable” on the dhcp menu.

    #49181

    ppalias
    Member

    Try to edit file

    /root/kerbynet.cgi/scripts/dhcp_configfile
    #49182

    lidocaineus
    Member

    Yes, that’s where I’ve been looking to put it, but the script file is slightly complicated to decipher… all just to add two lines to a subnet declaration ( next-server a.b.c.d;
    filename “pxelinux.0”;
    )

    #49183

    lidocaineus
    Member

    Got it working. Added an additional variable in that file to read in an additional file that had the pxe boot specifications.

    It seems that adding a blanket “additional DHCP subnet options” to the GUI wouldn’t be hard if another variable was added in a similar fashion that just read in a ‘misc’ file.

    #49184

    ppalias
    Member

    Yes indeed, adding a field for custom DHCPD commands would be the best.

    #49185

    luckas
    Member

    Yes, it would be a good idea add an optional dhcp options.
    Until it will, I’ve added this code in /root/kerbynet.cgi/scripts/dhcpd_configfile in line 115:


    echo " next-server 192.168.2.4;"
    echo " filename "pxelinux.0";"

    I don’t know if when I reboot it will reset but I’ll try.

    #49186

    ppalias
    Member

    It will reset it, you have to make the changes permanent by running a pre-boot script. You can save the file you will use for the change somewhere in /Database .

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.