-
Microsoft Intune
-
- Articles coming soon
-
-
Entra ID
-
- Articles coming soon
-
-
Microsoft Azure
-
Windows
-
Microsoft 365
-
- Articles coming soon
-
Linux
-
Netværk
-
Other
-
- Articles coming soon
-
Basic DHCP server installation on ubuntu (isc-dhcp-server)
DHCP (Dynamic Host Configuration Protocol) simplifies network management by automatically assigning IP addresses, gateways, DNS servers and many other options to devices. It saves time, minimizes errors, and prevents IP conflicts.
A Linux-based DHCP server is ideal because it is stable, flexible, secure, and free. With open-source solutions like ISC DHCP, it can be customized for both small and large networks, making administration efficient and cost-effective.
Step 1: Update and Upgrade
This will make sure that all your packages are up to date aswell as the package libary.
sudo apt update && sudo apt upgrade -y
Step 2: Install ISC-DHCP-SERVER
This is the installation command for the ISC DHCP Server package, this will install the package directly from Ubuntu’s package libary
sudo apt install isc-dhcp-server -y
Step 3: Change network interface
Change INTERFACESv4=“interface” to the your desired interface
You should set this setting to the network adapter, where you want the DHCP to listen and respond to DHCP traffic. Hint use command “ip address” to see a list of all interfaces
# Use nano to edit isc-dhcp-server configuration file
nano /etc/default/isc-dhcp-server
# look for this setting inside the config:
INTERFACESv4="eth4"
Step 4: Setup DHCP Scopes and DHCP options
Edit this document to match your requirements. Pay attention to spacing, brackets, etc. if the format is incorrect the service won’t start
OBS: Its very important that you create a scope for its own connected network otherwise the service won’t start.
nano /etc/dhcp/dhcpd.conf
The configuration file will have a lot of default options in the top of the documents, these will apply if not overwritten in the scope it self.
ISC DHCP Server provides you with some default scopes, uncomment them and configure them to match your network details.
Here is an example of a scope configuration. Other DHCP options can be found here: https://kb.isc.org/docs/isc-dhcp-44-manual-pages-dhcp-options
Use # to uncomment a single line delete it if the option is not needed
subnet 10.0.100.0 netmask 255.255.255.240 {
range 10.0.100.10 10.0.100.14;
option domain-name-servers 10.0.100.5;
# option domain-name "internal.example.org";
option subnet-mask 255.255.255.240;
option routers 10.0.100.1;
option broadcast-address 10.0.100.15;
# default-lease-time 600;
# max-lease-time 7200;
}
Step 5: Restart and verify ISC-DHCP-SERVER Service
sudo systemctl restart isc-dhcp-server.service
sudo systemctl status isc-dhcp-server.service