Adding custom options to dhcpd. (not available in GUI)



  • Hello all

    how can i add custom options to the dhcpd.conf ?
    I found the following thread (with a similar question) by searching/reading the forums: http://forum.pfsense.org/index.php/topic,12605.msg68224.html#msg68224 - unfortunately it has no answers.
    My problem is similar, because I need the following:

    1. add option to dhcpd.conf: deny known clients
      (yes, known clients, not UNknown, this I can find in the webgui)

    2. and include a file with known hosts (generated by scripts on other machines and then distributed):
      include /path/to/my/list/of/known-hosts

    
    host machine01 {
        hardware ethernet 00:11:22:33:44:55
        option host-name machine01
    }
    host machine02 {
        hardware ethernet AA:BB:CC:DD:EE:FF
        option host-name machine02
    }
    etc
    
    

    with this setup I want dhcpd to only serve IPs to guest machines that are not registered yet in my infrastructure.

    any hint is highly appreciated.
    Thanks a lot,
    EPA



  • no offense, but that is kinda weird.  what problem are you trying to solve here?



  • So… when I didn't find anywhere in the webgui to put dhcp options (option x "y";) I took some time and added it to my 1.2.3-RELEASE. I needed "root-path". Well I completed it, and I'm happy with the outcome, but I wish I had searched this forums some more,

    since this is apparently already in 2.0. doh

    Anyway, if anyone would like the /usr/local/www/services_dhcp.php & /etc/inc/services.inc files I will post them.
    (only minor changes to services.inc -file, line 284-288)
    if (isset($dhcpifconf['dhcp-option'])) {
    foreach($dhcpifconf['dhcp-option'] as $key => $dhcpoption) {
    if ($dhcpoption != "") $dhcpdconf .= " option $key "$dhcpoption";\n";
    }
    }

    Screens:

    Files:
    removed

    edit: fixed links

    edit2: removed links, found some bugs in the code i made. go get pfS 2.0


Log in to reply