Include another config file from /etc/config/dhcp

Hi,

Is there a way to include another separate file from inside the /etc/config/dhcp (or other config) file?

I want to have a core config file, and then custom additions in a separate file.

Something like

option include '/etc/dhcp.custom'

Thanks!

See if this suits your needs:
https://openwrt.org/docs/guide-user/base-system/dhcp

confdir points to /tmp/dnsmasq.d files placed there are treated as config files.

Note this is non permanent storage so you need to recreate on boot up.

Alternatively you can add your DNSMasq options to /etc/dnsmasq.conf that is permanent storage

1 Like

Thanks, that's what I wanted.

Is the syntax inside the included confdir files the same uci style, i.e.

config dhcp 'xxx'
        option interface 'xx'

or raw dnsmasq config parameters?

Thanks!

Just dnsmasq config parameters.

Some adblock scripts use this to add large files in the confdir with: local=/pixel.ad/ to block DNS for advertising sites

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.