72
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.
8.4.1 Network topology
Declarations about network topology include the
shared-network
and the
subnet
declarations. If clients on
a subnet are to be assigned addresses dynamically, a
range
declaration must appear within the
subnet
declaration. For clients with statically assigned addresses, or for installations where only known clients
will be served, each such client must have a
host
declaration. If parameters are to be applied to a group
of declarations which are not related strictly on a per-subnet basis, the
group
declaration can be used.
For every subnet which will be served, and for every subnet to which the DHCP server is connected,
there must be one
subnet
declaration, which informs DHCP of the addresses present on that subnet. A
subnet
declaration is required for each subnet even if no addresses will be dynamically allocated on that
subnet.
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
subnet
declarations for these two networks may be enclosed in a
shared-network
declaration. 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
host
declarations, these declarations can be enclosed in a
group
declaration along with the parameters which
are common to that department. For clients whose addresses will be dynamically assigned, there is
currently no way to group parameter assignments other than by network topology. When a client is to
be booted, its boot parameters are determined by first consulting that client’s
host
declaration (if any),
then consulting the
group
declaration (if any) which enclosed that
host
declaration, then consulting the
subnet
declaration for the subnet on which the client is booting, then consulting the
shared-network
declaration (if any) containing that subnet, and finally consulting the top-level parameters which may be
specified outside of any declaration. When DHCP tries to find a
host
declaration for a client, it first looks
for a
host
declaration which has a
fixed-address
parameter which matches the subnet or shared network
on which the client is booting. If it doesn’t find any such entry, it then tries to find an entry which has no
fixed-address parameter. If no such entry is found, then DHCP acts as if there is no entry in the
dhcpd.conf
file for that client, even if there is an entry for that client on a different subnet or shared
network.
8.4.2 Declarations
Subnet
subnet
subnet-number
netmask
netmask
{
[
parameters
]
[
declarations
]
}
The
subnet
statement is used to provide the DHCP server with enough information to determine whether
or not an IP address is on that subnet.
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
range
declaration.
subnet-number
should be an IP address which resolves to the subnet number of the subnet being
described. The
netmask
should be an IP address which resolves to the subnet mask of the subnet being
described. The subnet number, together with the subnet mask, are sufficient to determine whether any
given IP address is on the specified subnet.
Although a subnet mask 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; any
subnet-mask
option statement will override the subnet mask declared
in the
subnet
statement.
Range
range [ dynamic-bootp ] low-address [ high-address ];