DHCP dynamic IP assignation

Access configuration file

The main configuration file is /etc/dhcp/dhcpd.conf

vim /etc/dhcp/dhcpd.conf

Random IP assignation

The following configuration will accept all clients and give them a random IP @.

# Sample /etc/dhcpd.conf
# (add your comments here) 
default-lease-time 600;
max-lease-time 7200;
option subnet-mask;
option broadcast-address;
option routers;
# Put your own DNS server or your ISP | Google servers
option domain-name-servers,;
# Put your domain name - if you have one
option domain-name "mydomain.lan";
option ntp-servers;

subnet netmask {

You have to adjust:

  • Network parameters - instead of 172.16.50.*
  • DHCP range(s). In the given example there are 2 ranges from 10-100 and 150-200