host config file based on vendor specific options and service level

Glenn Satchell Glenn.Satchell at uniq.com.au
Fri Apr 7 11:33:45 UTC 2006


Hmm, don't know what happened, but the second half of the message got
chopped off that I received back from the list ...

------------- Begin Forwarded Message -------------

>Date: Thu, 6 Apr 2006 20:56:02 +0200
>From: "roger murray" <romu42 at gmail.com>
>To: dhcp-users at isc.org
>Subject: host config file based on vendor specific options and service level
>
>Dear dhcp-users,
>We have a problem that we have solved, but we are not completely satisfied
>with the results. It works, but we were wondering if any of you had a
>suggestion to a better solution. The main problem with the solution is that
>it doubles our start up time. 30 seconds from 15. We restart the dhcpd every
>5th minute.  We have discussed OMAPI, but are not mature to the idea yet.
>Problem:
>Based on vendor-specific-options and a service level defined by a
>provisioning system offer the proper configuration file to the host.
>
>Constraints:
>All hosts will be assigned a fixed ip address due to monitoring tools and
>current routines. (190,000+ hosts, 350+ shared networks, 1800+ subnets)
>
>Current solution is that we specify the hosts and service levels in a
>database and build the dhcpd.conf file with a script restarting the dhcpd
>every 5 minutes. Start up takes 12-15 seconds.
>
>The proposed solution is to using vendor-specific-options match the proper
>configuration file in the host declaration.
>
>ex. host declarations before change:
>
>host A1 {
>       filename "service_A";
>       hardware ethernet aa:bb:cc:dd:ee:ff;
>       fixed-address 10.xx.yy.zz;
>}
>
>ex. host declarations after change:
>
>host A1 {
>       if (substring (option Vendor.model, 0, 6) = "Model_1") {
>               filename "config_file_1";
>       } else (substring (option Vendor.model, 0, 6) = "Model_2") {
>               filename "config_file_2";
>       }
>       hardware ethernet aa:bb:cc:dd:ee:ff;
>       fixed-address 10.xx.yy.zz;
>}

What about putting the "if" part in the global scope, assuming the same
set of config_file_* and vendor.model apply to all hosts, eg:

if (substring (option Vendor.model, 0, 6) = "Model_1") {
        filename "config_file_1";
} elsif (substring (option Vendor.model, 0, 6) = "Model_2") {
        filename "config_file_2";
}

host A1 {
       hardware ethernet aa:bb:cc:dd:ee:ff;
       fixed-address 10.xx.yy.zz;
}

or, perhaps using classes, eg:

class "Model_1" {
       match if substring (option Vendor.model, 0, 6) = "Model_1";
       filename "config_file_1";
}
class "Model_2" {
       match if substring (option Vendor.model, 0, 6) = "Model_2";
       filename "config_file_2";
}
host A1 {
       hardware ethernet aa:bb:cc:dd:ee:ff;
       fixed-address 10.xx.yy.zz;
}

I guess the method using classes might be a little quicker to parse,
but it should be easy enough to test by creating a file in each format
and running

  dhcpd -t -cf dhcpd.conf.test
  
and timing that. Of course if you have many different config files, and
they could be different for similar hosts, or there isn't a 1:1
correspondance between Vendor.model and filename, then this scheme
won't work.

I saw Simon's reply and the idea of using more than one dhcp server
should definitely reduce the impact of a 30 second (or longer) startup
every 5 minutes. If the above ideas work then using omapi would be very
easy as a simple host record is all that would be added.

I'm sure there are many on the list who would be interested in hearing
how you go, given the large network you're running.

regards,
-glenn

------------- End Forwarded Message -------------




More information about the dhcp-users mailing list