Fedora 27: Install dhcp for DHCP server

Table of Contents

1 Install dhcp

Install dhcp package with dnf.

$ sudo dnf install -y dhcp$ sudo firewall-cmd –add-service=dhcp –permanent$ sudo firewall-cmd –reload$ sudo systemctl enable dhcpd$ sudo systemctl restart dhcpd

2 /etc/dhcp/dhcpd.conf

Define domain name, DHCP server IP address and gateway IP address. Mapping MAC address 52:54:00:5e:7a:a4 to IP address

$ cat /etc/dhcp/dhcpd.confsubnet netmask { option domain-name “hiroom2.com”; option domain-name-servers,; option routers;}host client { hardware ethernet 52:54:00:5e:7a:a4; fixed-address;}

Restart dhcpd for update confituration.

$ sudo systemctl restart dhcpd

3 Execution result

Run the following command on client machine.

IP address is provided.

$ ip a s<snip>2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:5e:7a:a4 brd ff:ff:ff:ff:ff:ff inet brd scope global dynamic ens3 valid_lft 43069sec preferred_lft 43069sec inet6 fe80::6501:7500:7614:8a9f/64 scope link valid_lft forever preferred_lft forever

DNS servers are provided.

$ cat /etc/resolv.conf# Generated by NetworkManagersearch hiroom2.comnameserver

Android | Linux | SDL - Narrow Escape