3.2 The configuration file
The configuration file of dhcpd3 is /etc/dhcp3/dhcpd.conf. Let us examine the important lines in the configuration file (for
most common DHCP setups). Note that each line terminates with a semicolon, unless it ends with a close curly brace
}.
- ddns-update-style none;
This is none for backward compatibility with DHCP version 2.
- option domain-name "mynet.org";
This is the name of the domain.
- option domain-name-server ns1.mynet.org, ns2.mynet.org;
This states which DNS servers a DHCP client should use.
- default-lease-time 600;
What is the default lease time? This is the number of seconds for a default lease to expire. Before a lease
expires, a DHCP client must make another request to a DHCP server.
- max-lease-time 7200;
A DHCP client may request that the least time be different from the default. This option sets a limit of how
much lease time can be granted.
- log-facility local7;
This redirects the log of the DHCP server to whatever name is stated.
- subnet 192.168.1.0 netmask 255.255.255.0 { }
This states that the local network has an address of 192.168.1.0, and the lowest 8 bits are reserved for a
host. This configuration also implies that the broadcast address of this subnet is 192.168.1.255. Note that
this setting implies that all addresses within this subnet are dynamically allocated. It leaves no room for any
fixed IP address allocation!
The configuration file can take some complex rules. If you do not wish to hand edit these rules, you can consider using a
GUI tools. gadmintools (which includes gdhcpd) is a GTK+ based tool to help you edit the configuration file. It looks just
like the GUI/web frontend of most residential gateway/routers!