Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
Setting the default and maximum lease   times
—default-lease-time 3600 and max-lease-time 14400

Other settings in the first part include whether the server is the primary
(authoritative) server and what type of logging DHCP should use. These
settings are considered defaults, and you can override them with the subnet
and host portion of the configuration in more complex situations.


NOTE
The dhcpd.conf file requires a semicolon (;) after each command
statement. If your configuration file has errors or runs improperly, check to
make sure the semicolons appear where needed.

The next part of the dhcpd.conf file deals with the different subnets that
your DHCP server serves; this section is quite straightforward. Each subnet is
defined separately and can look like this:


Click here to view code image
subnet 10.5.5.0 netmask 255.255.255.224 {
range 10.5.5.26 10.5.5.30;
option domain-name-servers ns1.internal.example.org;
option domain-name "internal.example.org";
option routers 10.5.5.1;
option broadcast-address 10.5.5.31;
default-lease-time 600;
max-lease-time 7200;
}


This defines the IP addressing for the 10.5.5.0 subnet. It defines the IP address
range from 10.5.5.26 through 10.5.5.30 to be dynamically assigned to hosts
that reside on that subnet. This example shows that you can set any TCP/IP
option from the subnet portion of the configuration file. It shows which DNS
server the subnet will connect to, which can be good for DNS server load
balancing, or which can be used to limit the hosts that can be reached through
DNS. It defines the domain name, so you can have more than one domain on
your network. It can also change the default and maximum lease times.


If you want your server to ignore a specific subnet, you can do so as follows:


Click here to view code image
subnet 10.152.187.0 netmask 255.255.255.0 {
}


This defines no options for the 10.152.187.0 subnet; therefore, the DHCP
server ignores it.


The last part of the dhcp.conf file is for defining hosts. This can be good if

Free download pdf