DHCP

Ubuntu

Install DHCP server

sudo apt install isc-dhcp-server

Configuration

Note: Prior to configurations, make sure the targeted interface card is properly setup. May need to assign a static gateway IP to the interface card.

1. Edit the file /etc/default/isc-dhcp-server

INTERFACESv4="eth0"

2. Define your DHCP server options

sudo vi /etc/dhcp/dhcpd.conf

Global parameters

option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
default-lease-time 3600; 
max-lease-time 7200;
authoritative;

Define a subnet

[Optional] Configure static IP

3. Start DHCP serivce automatically

4. Allow DHCP service on firewall

References

Last updated

Was this helpful?