LAB 11 – Install and Configure DHCP Server on Ubuntu Server
1. Install DHCP Server
To get started, we need to install the DHCP server package. Fortunately, it is included in
the default Ubuntu repository. Open your terminal and enter the following command to
install the DHCP server:
ip a
sudo apt-get install isc-dhcp-server -y
Once the installation is complete, start the DHCP service and enable it to start at system
reboot by executing the following command:
sudo systemctl start isc-dhcp-server
sudo systemctl enable isc-dhcp-server
2. Configure DHCP Service
The default configuration file for the DHCP server is located at /etc/default/isc-dhcp-
server. Open the file using your preferred text editor
sudo nano /etc/default/isc-dhcp-server
In this file, you will need to define your network interface. Locate the line that begins
with INTERFACESv4 and modify it to reflect your network interface.
INTERFACESv4="enp0s3"
Save and close the file. Next, we will edit the DHCP server configuration file located at
/etc/dhcp/[Link]:
sudo nano /etc/dhcp/[Link]
In this file, you can define various DHCP lease options such as default lease time,
maximum lease time, subnet range, gateway address, and DNS server address.
Uncomment the line that says authoritative; to make this DHCP server authoritative for
the specified subnet.
Modify the following lines according to your network configuration:
Save and close the file.
Restart the DHCP service to apply the changes:
sudo systemctl restart isc-dhcp-server
sudo netstat -anp | grep dhcp
Configure DHCP Client to Obtain Dynamic IP address
Access the client AlmaLinux machine:
Verify the IP address assigned by the DHCP server:
Check dhcp-lease-list on ubuntu server
End of lab