It’s quite easy to quickly setup a DHCP server on Fedora/Centos machine.

[[email protected] ~]# dnf -y install dhcp
[[email protected] ~]# vi /etc/dhcp/dhcpd.conf
# create new
# specify domain name
option domain-name “yourdomain.com”;
# specify DNS server’s hostname or IP address
option domain-name-servers 10.0.0.1;
# default lease time
default-lease-time 600;
# max lease time
max-lease-time 7200;
# this DHCP server to be declared valid
authoritative;
# specify network address and subnet mask
subnet 10.0.0.0 netmask 255.255.255.0 {
# specify the range of lease IP address
range dynamic-bootp 10.0.0.200 10.0.0.254;
# specify broadcast address
option broadcast-address 10.0.0.255;
# specify default gateway
option routers 10.0.0.1;
}

Start DHCP server and enable it on startup

[[email protected] ~]# systemctl start dhcpd

[[email protected] ~]# systemctl enable dhcpd

If you have Fedora firewalld running, allow DHCP service (UDP port 67)

[[email protected] ~]# firewall-cmd –add-service=dhcp –permanent
success
[[email protected] ~]# firewall-cmd –reload
success