Compressed Config

Glenn Satchell Glenn.Satchell at
Wed May 14 11:12:23 UTC 2008

>Subject: Compressed Config
>Date: Tue, 13 May 2008 15:43:10 -0400
>From: "Todd Snyder" <tsnyder at>
>Good day,
>I'm setting up a new DHCP server, which will serve about 300 new
>subnets.  My subnets are all exactly the same:
>subnet netmask {
>         range;
>         option broadcast-address;
>         option domain-name "prov0.cfg2";
>         option domain-name-servers,;
>         option routers; 
>And I increment my 3rd octet all the way up to 254.
>Same with another network.
>Given the sameness of all the subnets, is there a clever way to define
>these so each one isn't declared?  Something similar to the $GENERATE
>directive in named?  It seems like a lot of work when you have hundreds
>of the exact same lines, except 2 numbers changing ...
>I'm not fond of the number of lines in the above - my understanding is
>that I could do this as well:
>Subnet netmask { range
>; option routers; }; 
>And define the rest of the options as a more global scope ... Am I

$GENERATE is a BIND thing. Some company, different project :)

You are spot on. Broadcast address gets worked out from subnet and
netmnask, domain-name and domain-name-servers specified in global scope
is easier for the dhcp server too.

I think a simple script to generate the subnet definitions is what you

eg in perl
foreach my $n in (1..254) {
  print "subnet 172.25.$n.0 netmask ....\n";


More information about the dhcp-users mailing list