spreadsheet(s)
make-dhcpd.conf -- generate dhcpd.conf for ISC DHCP
make-dhcpd.conf -n net/mask [OPTIONS] file ...
This program creates a configuration file (usually
/etc/dhcpd.conf) from data read from one or more Excel spreadsheets. It can
provide a fixed IP address for each host listed in the spreadsheet(s),
and can also allocate ranges of addresses for dynamic allocation. The
program reads the information from the spreadsheet(s) and generates
a complete /etc/dhcpd.conf file, replacing the previous
configuration file completely. Information comes from two sources:
the spreadsheet(s) and the options provided on the command line. Some
defaults come from information the program determines about the host
on which the program runs. The output of this program is sent to
standard output; you need to redirect it into a file.
The main purpose of this program is to provide a quick and reliable system for easily incorporating information about clients into the dhcpd.conf configuration file. In its current state it supports only fixed addresses for clients, but if users wish it, it could easily be modified to provide support for dynamic address allocation for registered clients only.
A further aim is to be able to use the same source of information about clients to create DNS records for name servers. A program already exists to updates DNS records (built on the h2n program), but more work remains to make that program as flexible as this one.
The options (mostly) are provided in both a long and a short form. The short form takes one hyphen, the long form requires two. Spaces between the short option and its argument are optional; the long form must have either a space or an equals sign separating the option from its argument. Options can be given in any order, including the file name. This behaviour provides standard POSIX syntax for command line options, with GNU extensions.
The input to this program is one or more files produced by Excel, saved as Text (tab delimited). The first row of each spreadsheet contains a header row. The columns and rows may be put in any order (except for the header row, which must be the first row). The order of the columns in the spreadsheets can be different from each other, even when these differently formatted worksheets are used together in one run of this program. A reasonable way to organise the data is one worksheet for each subnet.
Three columns are essential: one for the IP address, one for the Ethernet address and one for the host name. I suggest these names as the headings for these columns. Other columns are optional.
The heading for this column must contain a word that begins with ip (case does not matter).
I suggest put leading zeros, using groups of three digits for each octet to make it easy to sort in the Excel spreadsheet, so you can easily see what addresses are available (and which are duplicated!)
The heading for this column must contain any of these words: mac, ether, hardware, network card. Again, case does not matter.
The heading for this columnd must contain host name or workstation. Case does not matter.
spreadsheet(s)Other columns can provide information that can be stored in the configuration file next to the information for that host. Here are some examples of other headings. You can add whatever you think is reasonable. These are just what we use. The program does not depend on these names. The main purpose of these other columns is to provide HINFO, TXT and CNAME DNS records that can be accessed remotely to provide network administrators with information about machines that may be causing problems.
system(s) used, e.g., DOS/98/NT/Linux
spreadsheet(s) besides the host
name, IP address and Ethernet address, and create a comment for each
computer in the configuration file showing this data, just above the
entry for that machine. On by default.
--dns=192.168.129.49 --dns=192.168.129.50 --dns=192.168.129.51
They apply to all subnets.
make-dhcpd.conf \ --net 192.168/24 \ --net 192.168.100/24 \ --net 192.168.200/24 \ --gateway 192.168.100.254 \ --gateway 192.168.200.1 \ --gateway 192.168.0.254 \ --dns 192.168.0.1 \ --server 192.168.0.1 \ --domain sunday.com \ --range 192.168.0.20:192.168.0.30 \ --range 192.168.0.32:192.168.0.35 \ --range 192.168.0.39:192.168.0.52 \ --range 192.168.100.55:192.168.100.60 \ --range 192.168.100.32:192.168.100.35 \ --range 192.168.100.39:192.168.100.52 \ --range 192.168.200.20:192.168.200.30 \ --range 192.168.200.32:192.168.200.35 \ --range 192.168.200.39:192.168.200.52 \ --nocomments \ named/sunday-ip-address.txt > /etc/dhcpd.conf
make-dhcpd.conf \ --wins 202.20.100.226 --wins 192.168.129.100 \ --dns 192.168.129.49 --dns 202.40.209.220 --dns 192.168.129.49 \ --server 192.168.129.49 \ --gateway 192.168.129.254 \ --maxlease 12 \ --deflease 12 \ --range 192.168.129.120:192.168.129.170 \ --net 192.168.129/24 \ --domain tyee.vtc.edu.hk \ tcpipee2.txt > /etc/dhcpd.conf
Here is a minimal example:
make-dhcpd.conf --net 192.168.129/24 tcpipee2.txt
It's probably a good idea to put your options into a file and execute it as a shell script.
Nick Urbanik <nicku@vtc.edu.hk> Please feel free to contact me for any wishes you may have for this program. Please let me know where this documentation is unclear.
Does not support classes in dhcp version 3.
Really mainly for allocating fixed addresses.
The lease times apply to all subnets.
People may be confused by so many options!
Please tell me if you find any more!
This is freely distributable and may be freely modified as long as my name is not removed from the program.
See the documentation for the ISC DHCP server. Also see the URL
I maintain a Red Hat Package of the latest dhcp server; please contact me for it. You can find out what documentation is available by doing:
rpm -qld dhcp
which will list the documentation files, which includes the RFCs and IETF drafts, as well as the man pages. These include:
dhcpd.conf(5), dhcp-options(5), dhcp-eval(5), dhcpd(8), dhcpd.leases(5), dhcrelay(8). See also h2n(2).
Programs exist to analyse the dynamically allocated leases. One such program is written in Perl and is called leases.