Dnsmasq/dhcp config classification options

Looking at the detail here:

https://lede-project.org/docs/user-guide/dhcp_configuration

Does anyone have a working example of the classification options ? I have tried a number of things and they aren't reflected in the dnsmasq.conf file being generated - from which I take it that I got the syntax incorrect.

I am trying this kind of thing:

config vendorclass 'ubnt'
option classifier 'ubnt'
list dhcp_option 'vendor:ubnt,1,192.168.1.10'

I'm also not sure how networkid fits in - there is a description that seems to imply that it ends up being used as a tag - but not clear how this would work on non static leases - and in any case attempting to add this to a static lease doesn't end up with any changes being reflected in the generated dnsmasq.conf file.

Yes...

Well, that's because..one of your options should be specified in the WAN section of /etc/config/network, not DHCP.

   option vendorid 'foo'

It sends vendor ID to the ISP.

Also, your DHCP option appears to be wrong. DHCP option 1 specifies the subnet mask...that doesn't appear to be what you configured:

list dhcp_option '1,255.255.255.0'

See: https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

Hope this helps.

I'm do not think that's the only use of it, see here: https://lede-project.org/docs/user-guide/dhcp_configuration#classifying_clients_and_assigning_individual_options

vendorid is one of the possible values for classifier listed.

This isn't however what I'm trying to do - I want to send a vendor option (option 43) with a nested (vendor specific ID 1) inside it. The equivalent option in the dnsmasq.conf file itself would be:

dhcp-option=vendor:ubnt,1,192.168.1.6

which in fact works, and is a supported config, see this by the dnsmasq author:

http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2014q4/008912.html

As a followup, I was able to get the following to work with qualifications:

config vendorclass 'ubiquity'
    option vendorclass 'ubnt'
    option networkid 'vendor:ubnt'
    list dhcp_option '1,192.168.1.10'

Which produces the following:

dhcp-vendorclass=vendor:ubnt,ubnt
dhcp-option=vendor:ubnt,1,192.168.1.10

Which works - but only because dhcp-option is no longer qualified by the vendor class.

The goal is to produce this:

dhcp-vendorclass=set:ubiquity,ubnt
dhcp-option=tag:ubiquity,1,192.168.1.10

However this isn't possible because the init.d script just blindly adds the networkid to the dhcp_option, and there is no other config option that will achieve anything like this.

1 Like