Linux: Ubuntu 18.04 DHCP Server
- 2 minsINTRODUCTION
Ever wonder how to setup a DHCP server on a Linux? It’s quite easy. Most people tend to do this on a Windows. However, if you want to make Linux your one-stop-shop for IP address management, continue reading.
In this example, I go through the process of setting up DHCP on Ubuntu Server 18.04 in my VMWare Fusion home lab.
WHAT IS DHCP?
Dynamic Host Configuration Protocol (DHCP) is a network management protocol used to automate the process of configuring devices on IP networks, thus allowing them to use network services such as DNS, NTP, and any communication protocol based on UDP or TCP. A DHCP server dynamically assigns an IP address and other network configuration parameters to each device on a network so they can communicate with other IP networks.
REQUIREMENTS
- Lab environronment & a running instance of Ubuntu 18.04.
DEPLOYMENT PROCESS OVERVIEW
- Install DHCP Server
- Configure DHCP Server
- Restart the DHCP server.
- Verify configurations
TIME TO IMPLEMENT: 10 minutes
INSTALL THE DHCP SERVER
- First, run the following command to make sure everything is up to date.
- Now, run the following command to install the DHCP server
sudo apt-get update
sudo apt-get install isc-dhcp-server -y
CONFIGURE THE DHCP SERVER
- Now, configuring the DHCP server by issuing the following command:
- In dhcpd configuration file, you need to specify a couple of things to get up and running. See screenshot below
- Uncomment out (remove the # character) the following line:
- Scroll to the end of the dhcpd configuration file and be sure to adjust accordingly to fit your networking needs:
- Save and close dhcpd.conf file.
sudo nano /etc/dhcp/dhcpd.conf
#authoritative;
RESTART THE DHCP SERVER
- Restart the DHCP server with the following command:
sudo systemctl restart isc-dhcp-server.service
VERIFY CONFIGURATIONS
- To list out any address that have been handed out by you Linux DHCP server, issue the following command:
dhcp-lease-list
SUMMARY
- The setup is straight forward and isn't a time drain.
- The linux CLI is swift and can be a lot easier to manage than navigating the Windows gui.
- Linux is extremely leightweight when compared to Windows (for instance, Linux doesn't require a lot of RAM) so having this option is very convenient.