• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

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

Scheduled Pinned Locked Moved DHCP and DNS
3 Posts 3 Posters 2.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    epa
    last edited by Jul 13, 2010, 1:54 PM

    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

    1 Reply Last reply Reply Quote 0
    • D
      danswartz
      last edited by Jul 15, 2010, 10:58 PM

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

      1 Reply Last reply Reply Quote 0
      • P
        pungsnurr
        last edited by Aug 9, 2010, 1:05 AM Aug 8, 2010, 11:30 PM

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
          This community forum collects and processes your personal information.
          consent.not_received