In this episode we talk about setting up a DHCP server on Linux. We go through the process of installing the software, configuring the service, and analyzing how DHCP works. We also talk about how some of this applies to security. We learned a lot from this project.

DHCPD.CONF FILE – IP addresses were changed for security reasons

# minimal sample /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;

subnet 10.200.5.0 netmask 255.255.255.0 {
 range 10.200.5.100 10.200.5.200;
 option routers 10.200.5.1;
 option domain-name-servers 10.250.1.2;
 option domain-name "section9.lan";
}

THE LOG FILE – Example of the DHCP process

Jan 30 20:16:15 debian dhcpd[1397]: DHCPDISCOVER from 55:ee:76:51:89:ec via enp0s3
Jan 30 20:16:16 debian dhcpd[1397]: DHCPOFFER on 10.200.5.100 to 55:ee:76:51:89:ec (DESKTOP-O40EC06) via enp0s3
Jan 30 20:16:16 debian dhcpd[1397]: DHCPREQUEST for 10.200.5.100 (10.100.5.6) from 55:ee:76:51:89:ec (DESKTOP-O40EC06) via enp0s3
Jan 30 20:16:16 debian dhcpd[1397]: DHCPACK on 10.200.5.100 to 55:ee:76:51:89:ec (DESKTOP-O40EC06) via enp0s3