How to use DHCP options in Dnsmasq?

Started by echoxxzz, Today at 04:31:40 AM

Previous topic - Next topic
The DHCP options settings interface in Dnsmasq is a tad confusing.

You can select both a DHCP4 option and a DHCP6 option, but there is only one place to set a value. So which option does the value apply to?

For example, if I want to set the DNS servers, I would pick Option4 dns-server[6] and Option6 dns-server[23], but what value do I put? Is it the IPv4 DNS server than a colon and then the IPv6 DNS-servers?

If, on the other hand, you should only pick one Option type at a time, someone should redesign the interface to make this a little more intuitive.

Its one or the other,IPv4 -or- IPv6. You have to create individual IPv4 options, and seperate IPv6 options.

For your dns-server [6] option, that would only apply to IPv4, and the ip address you enter would of course only be IPv4 ip, seperated by a comma if entering multiple addresses.

Today at 05:10:49 AM #2 Last Edit: Today at 05:47:43 AM by OPNenthu
Someone (maybe @Monviech?) can speak to this authoritatively for OPNsense.  My interpretation is in line with @Mpegger.

I think evidence for this is in the Dnsmasq manual if looking at the syntax for --dhcp-option:

Quote-O, --dhcp-option=[tag:<tag>,[tag:<tag>,]][encap:<opt>,][vi-encap:<enterprise>,][vendor:[<vendor-class>],][<opt>|option:<opt-name>|option6:<opt>|option6:<opt-name>],[<value>[,<value>]]

They use OR (|) to indicate that you can pass either <option> or <option6>, but not both.

--

EDIT: actually, it looks like the OPNsense UI is explicit about it (screenshot) when you try to save :P