Sorry. I have no guide or the like. I can only recommend to use https://openwrt.org/docs/guide-user/base-system/dhcp and make the best out of it and pay closer attention to list dhcp_option
which translate to dnsmasq
config syntax --dhcp-option=
(See https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html).
For a full list of dhcp-options, see: https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml#options
If a name is supported by dnsmasq
, or not, you can check in the source, see this list: https://github.com/DNSFilter/dnsmasq/blob/master/src/dhcp-common.c#L498
For IPv6: The same.
If you do not find it in the openwrt wiki page, check the dnsmasq man page. And the IANA assignments are located here: https://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#dhcpv6-parameters-2
Config wise, I can provide you with a snippet I have in use:
(I can not recall the details, but I assume in /etc/config/dhcp
was some stanza for odhcp6
, which I have removed completly.)
I have this minimal config. What was once set in this file but is a default regarding to the wiki, was removed, so I should have only values left, which differ from the default. Please check yourself...
For each VLAN I have more or less the same settings, see below:
config dnsmasq
option leasefile '/tmp/dhcp.leases'
option localservice '0'
option fqdn '1'
option nonegcache '1'
option cachesize '1500'
config dhcp 'vlan17'
option interface 'vlan17'
option domain 'srv.mgmt.home.arpa'
option local '/srv.mgmt.home.arpa/'
option start '32'
option limit '215'
option leasetime '12h'
option dhcpv4 'server'
list dhcp_option 'option:dns-server, 192.168.0.1'
list dhcp_option 'option:domain-name, srv.mgmt.home.arpa.'
list dhcp_option 'option:ntp-server, 192.53.103.103'
list dhcp_option '100,UTC' # PCode
list dhcp_option '101,UTC' # TCode
list dhcp_option 'option:domain-search, srv.mgmt.home.arpa.'
option dhcpv6 'server'
list dhcp_option 'option6:dns-server, [fde6:a09a:b373::1]'
list dhcp_option 'option6:domain-search, srv.mgmt.home.arpa.'
list dhcp_option 'option6:ntp-server, de.pool.ntp.org.'
option ra 'server'
option ra_slaac '1'
list ra_flags 'managed-config'
list ra_flags 'other-config'
Edit: Pay attention that the code block has a scrollbar!