|
NAMEdhcpd.conf —
DHCP server configuration file
DESCRIPTIONThedhcpd.conf file contains configuration information
for
dhcpd(8),
the Internet Software Consortium DHCP Server.
The The file essentially consists of a list of statements. Statements fall into two broad categories - parameters and declarations. Parameter statements say how to do something (e.g., how long a lease to offer), whether to do something (e.g., should dhcpd(8) provide addresses to unknown clients), or what parameters to provide to the client (e.g., use gateway 220.177.244.7). Declarations are used to describe the topology of the network, to describe clients on the network, to provide addresses that can be assigned to clients, or to apply a group of parameters to a group of declarations. In any group of parameters and declarations, all parameters must be specified before any declarations which depend on those parameters may be specified. Declarations about network topology include the
For every subnet which will be served, and for every subnet to
which the dhcp server is connected, there must be one
Some installations have physical networks on which more than one
IP subnet operates. For example, if there is a site-wide requirement that
8-bit subnet masks be used, but a department with a single physical Ethernet
network expands to the point where it has more than 254 nodes, it may be
necessary to run two 8-bit subnets on the same Ethernet until such time as a
new physical network can be added. In this case, the
Some sites may have departments which have clients on more than
one subnet, but it may be desirable to offer those clients a uniform set of
parameters which are different than what would be offered to clients from
other departments on the same subnet. For clients which will be declared
explicitly with When a client is to be booted, its boot parameters are determined
by first consulting that client's When
dhcpd(8)
tries to find a EXAMPLESA typicaldhcpd.conf file will look something like this:
Example 1 global parameters... shared-network ISC-BIGGIE { shared-network-specific parameters ... subnet 204.254.239.0 netmask 255.255.255.224 { subnet-specific parameters ... range 204.254.239.10 204.254.239.30; } subnet 204.254.239.32 netmask 255.255.255.224 { subnet-specific parameters ... range 204.254.239.42 204.254.239.62; } } subnet 204.254.239.64 netmask 255.255.255.224 { subnet-specific parameters ... range 204.254.239.74 204.254.239.94; } group { group-specific parameters ... host zappo.test.isc.org { host-specific parameters ... } host beppo.test.isc.org { host-specific parameters ... } host harpo.test.isc.org { host-specific parameters ... } } Notice that at the beginning of the file, there's a place for global parameters. These might be things like the organization's domain name, the addresses of the name servers (if they are common to the entire organization), and so on. So, for example: Example 2 option domain-name "isc.org"; option domain-name-servers ns1.isc.org, ns2.isc.org; As you can see in Example 2, it's legal to specify host addresses in parameters as hostnames rather than as numeric IP addresses. In Example 1, you can see that both the shared-network statement and the subnet statements can have parameters. Let us say that the shared network ISC-BIGGIE supports an entire department - perhaps the accounting department. If accounting has its own domain, then a shared-network-specific parameter might be: option domain-name
"accounting.isc.org"; All subnet declarations appearing in the shared-network declaration would then have the domain-name option set to “accounting.isc.org” instead of just “isc.org”. The most obvious reason for having subnet-specific parameters as shown in Example 1 is that each subnet, of necessity, has its own router. So for the first subnet, for example, there should be something like: option routers
204.254.239.1; Note that the address here is specified numerically. This is not required - if you have a different hostname for each interface on your router, it's perfectly legitimate to use the hostname for that interface instead of the numeric address. However, in many cases there may be only one hostname for all of a router's IP addresses, and it would not be appropriate to use that name here. In Example 1 there is also a option domain-name
"test.isc.org"; Also, given the domain they're in, these are probably test machines. If we wanted to test the DHCP leasing mechanism, we might set the lease timeout somewhat shorter than the default: max-lease-time 120; default-lease-time 120; You may have noticed that while some parameters start with the
In Example 1, each host had host-specific
parameters. These could include such things as the
Imagine that you have a site with a lot of NCD X-Terminals. These terminals come in a variety of models, and you want to specify the boot files for each model. One way to do this would be to have host declarations for each server and group them by model: group { filename "Xncd19r"; next-server ncd-booter; host ncd1 { hardware ethernet 0:c0:c3:49:2b:57; } host ncd4 { hardware ethernet 0:c0:c3:80:fc:32; } host ncd8 { hardware ethernet 0:c0:c3:22:46:81; } } group { filename "Xncd19c"; next-server ncd-booter; host ncd2 { hardware ethernet 0:c0:c3:88:2d:81; } host ncd3 { hardware ethernet 0:c0:c3:00:14:11; } } group { filename "XncdHMX"; next-server ncd-booter; host ncd5 { hardware ethernet 0:c0:c3:11:90:23; } host ncd6 { hardware ethernet 0:c0:c3:91:a7:8; } host ncd7 { hardware ethernet 0:c0:c3:cc:a:8f; } } REFERENCE: DECLARATIONSTheshared-network statement informs the DHCP server
that some IP subnets actually share the same physical network:
Any subnets in a shared network should be declared within a
name should be the name of the shared network. This name is used when printing debugging messages, so it should be descriptive for the shared network. The name may have the syntax of a valid hostname (although it will never be used as such), or it may be any arbitrary name, enclosed in quotes. The
It may also be used to provide subnet-specific parameters and to
specify what addresses may be dynamically allocated to clients booting on
that subnet. Such addresses are specified using the
The subnet-number and netmask should be specified as numeric IP addresses. The subnet number, together with the netmask, are sufficient to determine whether any given IP address is on the specified subnet. Although a netmask must be given with every subnet declaration, it is recommended that if there is any variance in subnet masks at a site, a subnet-mask option statement be used in each subnet declaration to set the desired subnet mask, since any subnet-mask option statement will override the subnet mask declared in the subnet statement. The range
[dynamic-bootp ] low-address
[high-address];For any subnet on which addresses will be assigned dynamically,
there must be at least one There must be at least one
If it is desirable to be able to boot a DHCP or BOOTP client on
more than one subnet with fixed addresses, more than one address may be
specified in the fixed-address parameter, or more than
one If client-specific boot parameters must change based on the
network to which the client is attached, then multiple
If a client is to be booted using a fixed address if it's
possible, but should be allocated a dynamic address otherwise, then a
The
It can be used to group hosts, shared networks, subnets, or even other groups. REFERENCE: ALLOW and DENYTheallow and deny statements
can be used to control the behaviour of
dhcpd(8)
to various sorts of requests.
The unknown-clients flag tells dhcpd(8) whether or not to dynamically assign addresses to unknown clients: allow unknown-clients; deny unknown-clients; Dynamic address assignment to unknown clients is allowed by default. The bootp flag tells dhcpd(8) whether or not to respond to bootp queries: allow bootp; deny bootp; Bootp queries are allowed by default. The booting flag tells dhcpd(8) whether or not to respond to queries from a particular client: allow booting; deny booting; This keyword only has meaning when it appears in a host declaration. By default, booting is allowed, but if it is disabled for a particular client, then that client will not be able to get an address from the DHCP server. REFERENCE: PARAMETERSThedefault-lease-time statement specifies the
time in seconds that will be assigned to a lease if the
client requesting the lease does not ask for a specific expiration time:
default-lease-time
time;The max-lease-time
time;The hardware
hardware-type hardware-address;hardware-type must be the name of a hardware
interface type. Currently, the The filename
“filename”;The filename should be a filename recognizable to whatever file transfer protocol the client can be expected to use to load the file. The server-name
“name”;name should be the name that will be provided to the client. The next-server
server-name;server-name should be a numeric IP address
or a hostname. If no The fixed-address
address [, address ...];It should only appear in a Clients with fixed addresses are not assigned DHCP leases, and may
therefore not be used with the The dynamic-bootp-lease-cutoff
date;Because BOOTP clients do not have any way of renewing leases, and don't know that their leases could expire, by default dhcpd(8) assigns infinite leases to all BOOTP clients. However, it may make sense in some situations to set a cutoff date for all BOOTP leases - for example, the end of a school term, or the time at night when a facility is closed and all machines are required to be powered off. date should be the date on which all assigned BOOTP leases will end. The date is specified in the form: W YYYY/MM/DD HH:MM:SS W is the day of the week expressed as a number from zero (Sunday) to six (Saturday). YYYY is the year, including the century. MM is the month expressed as a number from 1 to 12. DD is the day of the month, counting from 1. HH is the hour, from zero to 23. MM is the minute and SS is the second. The time is always in Coordinated Universal Time (UTC), not local time. The dynamic-bootp-lease-length
length;At some sites, it may be possible to assume that a lease is no longer in use if its holder has not used BOOTP or DHCP to get its address within a certain time period. The period is specified in length as a number of seconds. If a client reboots using BOOTP during the timeout period, the lease duration is reset to length, so a BOOTP client that boots frequently enough will never lose its lease. Needless to say, this parameter should be adjusted with extreme caution. The get-lease-hostnames
flag;If flag is true, then this lookup is done for all addresses in the current scope. By default, or if flag is false, no lookups are done. If the use-host-decl-names
flag;So, for example: group { use-host-decl-names on; host joe { hardware ethernet 08:00:2b:4c:29:32; fixed-address joe.fugue.com; } } is equivalent to: host joe { hardware ethernet 08:00:2b:4c:29:32; fixed-address joe.fugue.com; option host-name "joe"; } An The authoritative ;not authoritative ;The DHCP server will normally assume that the configuration information about a given network segment is known to be correct and is authoritative. So if a client requests an IP address on a given network segment that the server knows is not valid for that segment, the server will respond with a DHCPNAK message, causing the client to forget its IP address and try to get a new one. If a DHCP server is being configured by somebody who is not the network administrator and who therefore does not wish to assert this level of authority, then the statement “not authoritative” should be written in the appropriate scope in the configuration file. Usually, writing Note that the most specific scope for which the concept of authority makes any sense is the physical network segment - either a shared-network statement or a subnet statement that is not contained within a shared-network statement. It is not meaningful to specify that the server is authoritative for some subnets within a shared network, but not authoritative for others, nor is it meaningful to specify that the server is authoritative for some host declarations and not others. The use-lease-addr-for-default-route
flag;If the If The always-reply-rfc1048
flag;Some BOOTP clients expect RFC 1048-style responses, but do not follow RFC 1048 when sending their requests. You can tell that a client is having this problem if it is not getting the options you have configured for it and if you see in the server log the message “(non-rfc1048)” printed with each BOOTREQUEST that is logged. If you want to send RFC 1048 options to such a client, you can set
the The server-identifier
hostname;The value specified must be an IP address for the DHCP server, and must be reachable by all clients served by a particular scope. The use of the server-identifier statement is not recommended - the only reason to use it is to force a value other than the default value to be sent on occasions where the default value would be incorrect. The default value is the first IP address associated with the physical network interface on which the request arrived. The usual case where the Supplying a value for the
The echo-client-id
flag;Some devices, especially old printers, require
When REFERENCE: OPTION STATEMENTSDHCP option statements are documented in the dhcp-options(5) manual page.SEE ALSOdhcp-options(5), dhcpd.leases(5), dhcpd(8)STANDARDSR. Droms, Dynamic Host Configuration Protocol, RFC 2131, March 1997.S. Alexander and R. Droms, DHCP Options and BOOTP Vendor Extensions, RFC 2132, March 1997. M. Patrick, DHCP Relay Agent Information Option, RFC 3046, January 2001. B. Patel, B. Aboba, S. Kelly, and V. Gupta, Dynamic Host Configuration Protocol (DHCPv4) Configuration of IPsec Tunnel Mode, RFC 3456, January 2003. AUTHORSdhcpd(8) was written by Ted Lemon <mellon@vix.com> under a contract with Vixie Labs.The current implementation was reworked by Henning Brauer <henning@openbsd.org>.
Visit the GSP FreeBSD Man Page Interface. |