Configure and Use DHCP Server

Configure DHCP ( Dynamic Host Configuration Protocol ) Server

[1] Install and configure DHCP Server. In this example it is configured for the [] subnet.

[root@futurelinux ~]# dnf -y install dhcp

[root@futurelinux ~]# vi /etc/dhcp/dhcpd.conf
# specify domain name
option domain-name "";

# specify DNS server's hostname or IP address
option domain-name-servers;

# default lease time
default-lease-time 600;

# max lease time
max-lease-time 7200;

# this DHCP server to be declared valid

# specify network address and subnet mask
subnet netmask {
    # specify the range of lease IP address
    range dynamic-bootp;
    # specify broadcast address
    option broadcast-address;
    # specify default gateway
    option routers;

[root@futurelinux ~]# systemctl start dhcpd
[root@futurelinux ~]# systemctl enable dhcpd
Created symlink /etc/systemd/system/ β†’ /usr/lib/systemd/system/dhcpd.service.

[2] If Firewalld is running, allow DHCP service. DHCP uses 67/UDP.

[root@futurelinux ~]# firewall-cmd --permanent --add-service=dhcp
[root@futurelinux ~]# firewall-cmd --reload

Configure DHCP Client. DHCP Client uses 68/UDP.

[1] For Future OS Clients, Configure like follows. (Replace the device name [ens3] to your own device name)

[root@client ~]# nmcli connection modify ens3 ipv4.method auto
[root@client ~]# nmcli connection down ens3
Connection 'ens3' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
[root@client ~]# nmcli connection up ens3
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)