Installation guide
112 Chapter 12. Dynamic Host Configuration Protocol (DHCP)
Important
If you change the configuration file, the changes will not take effect until you restart the DHCP daemon
with the command service dhcpd restart.
In Example 12-1, the routers, subnet-mask, domain-name, domain-name-servers, and
time-offset options are used for any host statements declared below it.
As shown in Example 12-1, you can declare a subnet. You must include a subnet declaration
for every subnet in your network. If you do not, the DHCP server will fail to start.
In this example, there are global options for every DHCP client in the subnet and a range
declared. Clients are assigned an IP address within the range.
Example 12-1. Subnet Declaration
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option domain-name "example.com";
option domain-name-servers 192.168.1.1;
option time-offset -5; # Eastern Standard Time
range 192.168.1.10 192.168.1.100;
}
All subnets that share the same physical network should be declared within a shared-
network declaration as shown in Example 12-2. Parameters within the shared-network but
outside the enclosed subnet declarations are considered global parameters. The name of the
shared-network should be a descriptive title for the network such as test-lab to describe all
the subnets in a test lab environment.
Example 12-2. Shared-network Declaration
shared-network name {
option domain-name "test.redhat.com";
option domain-name-servers ns1.redhat.com, ns2.redhat.com;
option routers 192.168.1.254;
more parameters for EXAMPLE shared-network
subnet 192.168.1.0 netmask 255.255.255.0 {
parameters for subnet
range 192.168.1.1 192.168.1.31;
}
subnet 192.168.1.32 netmask 255.255.255.0 {
parameters for subnet
range 192.168.1.33 192.168.1.63;
}
}
As demonstrated in Example 12-3, the group declaration can be used to apply global pa-
rameters to a group of declarations. You can group shared networks, subnets, hosts, or other
groups.