[Dnsmasq-discuss] Vendor and User class compounds
Simon Kelley
simon at thekelleys.org.uk
Wed Sep 27 11:47:35 BST 2006
Francois-Xavier Le Bail wrote:
> Hi,
>
> I want to put some options for some hosts with the network-ids match system.
>
> These hosts are defined by such a test :
>
> (vendor-class = "Vendor_1" and
> (user-class = "device_1" or
> user-class = "device_2" or
> user-class = "...")
> ) or (
> vendor-class = "Vendor_2" and
> (user-class = "device_A" or
> user-class = "...")
> ) or (
> vendor-class = "Vendor_3" and
> (user-class = "device_AA" or
> user-class = "..."))
> ...
>
> Have you an example of a dnsmasq.conf file for this case ?
>
>
You need to do this in two stages: first set network-ids based on the
vendor-class and user-class ids:
dhcp-vendorclass = vendor1,"Vendor_1" # sets tag vendor1
dhcp-vendorclass = vendor2,"Vendor_2" # sets tag vendor2
# etc
dhcp-userclass = user1,"device_1" # sets tag user1
#etc
then you take advantage of the fact that dhcp-option lines can have more
than one tag, with an implied AND function. To get the OR function you
need to repeat the dhcp-option
dhcp-option=vendor1,user1,56,....... # send option 56 to hosts which are
# vendor1 and user1
dhcp-option=vendor2,user2,56,....... # OR to hosts which are vendor2 and
# user2
etc.
Be aware that the dhcp-vendorclass and dhcp-userclass statements do
substring matching, so they will set the tag if the given string is a
substring of the data supplied by the client.
HTH
Simon.
More information about the Dnsmasq-discuss
mailing list