Navigation

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

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

    DHCP and DNS
    3
    3
    2369
    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

      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

        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

          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